Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

AudioSwitch Class Reference

Inheritance diagram for AudioSwitch:

Inheritance graph
[legend]
Collaboration diagram for AudioSwitch:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AudioSwitch ()
virtual ~AudioSwitch ()
char * GetDescription () const
void GetFrame (int16_t **aframe, int16_t **bframe, int frequency, int channels, int &samples, double position, double frame_delta)
void AttachWidgets (GtkBin *bin)
void DetachWidgets (GtkBin *bin)

Private Attributes

GtkWidget * window
gfloat vectorA [MAX_VECTOR]
gfloat vectorB [MAX_VECTOR]

Constructor & Destructor Documentation

AudioSwitch::AudioSwitch  )  [inline]
 

Definition at line 78 of file audio_transitions.cc.

References magick_glade, and window.

00079     {
00080         window = glade_xml_get_widget( magick_glade, "window_switch" );
00081     }

virtual AudioSwitch::~AudioSwitch  )  [inline, virtual]
 

Definition at line 83 of file audio_transitions.cc.

References window.

00084     {
00085         gtk_widget_destroy( window );
00086     }


Member Function Documentation

void AudioSwitch::AttachWidgets GtkBin *  bin  )  [inline, virtual]
 

Reimplemented from GDKAudioTransition.

Definition at line 113 of file audio_transitions.cc.

References gtk_curve_reset_vector(), lookup_widget(), and window.

00114     {
00115         gtk_widget_reparent( ( GTK_BIN( window ) ) ->child, GTK_WIDGET( bin ) );
00116         GtkCurve *curveA = GTK_CURVE( lookup_widget( window, "curve1" ) );
00117         GtkCurve *curveB = GTK_CURVE( lookup_widget( window, "curve2" ) );
00118         gtk_curve_reset_vector( curveA );
00119         gtk_curve_set_curve_type( curveA, GTK_CURVE_TYPE_SPLINE );
00120         gtk_curve_set_curve_type( curveB, GTK_CURVE_TYPE_SPLINE );
00121     }

void AudioSwitch::DetachWidgets GtkBin *  bin  )  [inline, virtual]
 

Reimplemented from GDKAudioTransition.

Definition at line 123 of file audio_transitions.cc.

References window.

00124     {
00125         gtk_widget_reparent( ( GTK_BIN( bin ) ) ->child, GTK_WIDGET( window ) );
00126     }

char* AudioSwitch::GetDescription  )  const [inline, virtual]
 

Implements AudioTransition.

Definition at line 88 of file audio_transitions.cc.

00089     {
00090         return _( "Cross Fade" );
00091     }

void AudioSwitch::GetFrame int16_t **  aframe,
int16_t **  bframe,
int  frequency,
int  channels,
int &  samples,
double  position,
double  frame_delta
[inline, virtual]
 

Implements AudioTransition.

Definition at line 93 of file audio_transitions.cc.

References lookup_widget(), MAX_VECTOR, vectorA, vectorB, and window.

00094     {
00095         GtkCurve * curveA = GTK_CURVE( lookup_widget( window, "curve1" ) );
00096         GtkCurve *curveB = GTK_CURVE( lookup_widget( window, "curve2" ) );
00097         gtk_curve_get_vector( curveA, MAX_VECTOR, vectorA );
00098         gtk_curve_get_vector( curveB, MAX_VECTOR, vectorB );
00099         
00100         int pos = ( int ) ( position * MAX_VECTOR );
00101         double factorA = vectorA[ pos ];
00102         double factorB = vectorB[ pos ];
00103         if ( factorA + factorB > 1.0 )
00104         {
00105             factorA /= factorA + factorB;
00106             factorB /= factorA + factorB;
00107         }
00108         for ( int s = 0; s < samples; s ++ )
00109             for ( int c = 0; c < channels; c ++ )
00110                 aframe[ c ][ s ] = ( int16_t ) ( ( double ) aframe[ c ][ s ] * factorA + ( double ) bframe[ c ][ s ] * factorB );
00111     }


Member Data Documentation

gfloat AudioSwitch::vectorA[MAX_VECTOR] [private]
 

Definition at line 73 of file audio_transitions.cc.

Referenced by GetFrame().

gfloat AudioSwitch::vectorB[MAX_VECTOR] [private]
 

Definition at line 74 of file audio_transitions.cc.

Referenced by GetFrame().

GtkWidget* AudioSwitch::window [private]
 

Definition at line 72 of file audio_transitions.cc.

Referenced by AttachWidgets(), AudioSwitch(), DetachWidgets(), GetFrame(), and ~AudioSwitch().


The documentation for this class was generated from the following file:
Generated on Sun Mar 11 22:12:46 2007 for Kino by  doxygen 1.4.2