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

AudioGain Class Reference

Inheritance diagram for AudioGain:

Inheritance graph
[legend]
Collaboration diagram for AudioGain:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AudioGain ()
char * GetDescription () const
void GetFrame (int16_t **buffer, int frequency, int channels, int &samples, double position, double frame_delta)
void AttachWidgets (GtkBin *bin)
void DetachWidgets (GtkBin *bin)

Private Attributes

GtkWidget * m_window
GtkCurve * m_curve
gfloat m_vector [MAX_VECTOR]

Constructor & Destructor Documentation

AudioGain::AudioGain  )  [inline]
 

Definition at line 149 of file audio_filters.cc.

References m_curve, m_window, and magick_glade.

00150     {
00151         m_window = glade_xml_get_widget( magick_glade, "window_gain" );
00152         m_curve = GTK_CURVE( glade_xml_get_widget( magick_glade, "curve_gain" ) );
00153     }


Member Function Documentation

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

Reimplemented from GDKAudioFilter.

Definition at line 167 of file audio_filters.cc.

References gtk_curve_reset_vector(), m_curve, and m_window.

00168     {
00169         gtk_widget_reparent( ( GTK_BIN( m_window ) ) ->child, GTK_WIDGET( bin ) );
00170         while ( gtk_events_pending() )
00171             gtk_main_iteration();
00172         gtk_curve_reset_vector( m_curve );
00173         gtk_curve_set_curve_type( m_curve, GTK_CURVE_TYPE_LINEAR );
00174     }

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

Reimplemented from GDKAudioFilter.

Definition at line 175 of file audio_filters.cc.

References m_window.

00176     {
00177         gtk_widget_reparent( ( GTK_BIN( bin ) ) ->child, GTK_WIDGET( m_window ) );
00178     }

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

Implements AudioFilter.

Definition at line 154 of file audio_filters.cc.

00155     {
00156         return _( "Gain" );
00157     }

void AudioGain::GetFrame int16_t **  buffer,
int  frequency,
int  channels,
int &  samples,
double  position,
double  frame_delta
[inline, virtual]
 

Implements AudioFilter.

Definition at line 158 of file audio_filters.cc.

References m_curve, m_vector, and MAX_VECTOR.

00159     {
00160         gtk_curve_get_vector( m_curve, MAX_VECTOR, m_vector );
00161         int pos = int( position * MAX_VECTOR + 0.5 );
00162         double gain = m_vector[ pos ];
00163         for ( int s = 0; s < samples; s ++ )
00164             for ( int c = 0; c < channels; c ++ )
00165                 buffer[ c ][ s ] = int16_t( double( buffer[ c ][ s ] * gain + 0.5 ) );
00166     }


Member Data Documentation

GtkCurve* AudioGain::m_curve [private]
 

Definition at line 145 of file audio_filters.cc.

Referenced by AttachWidgets(), AudioGain(), and GetFrame().

gfloat AudioGain::m_vector[MAX_VECTOR] [private]
 

Definition at line 146 of file audio_filters.cc.

Referenced by GetFrame().

GtkWidget* AudioGain::m_window [private]
 

Definition at line 144 of file audio_filters.cc.

Referenced by AttachWidgets(), AudioGain(), and DetachWidgets().


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