

Public Member Functions | |
| WavSelect () | |
| ~WavSelect () | |
| void | SetWavInfoLabel (GtkLabel *label) |
| void | SetWavFileEntry (GtkEntry *entry) |
| void | WavFileSelected () |
| void | WavStart (int frequency, int samples, off_t offset) |
| int | WavRead (int16_t **a, int f, int c, int bytes, double gain=1.0) |
| bool | IsSelected () |
| int | GetAdjustedSamples (int frequency, int samples) const |
| int | WavGetFrequency () |
Private Attributes | |
| char | wav_file [PATH_MAX+NAME_MAX] |
| KinoAudioInput * | wav |
| GtkLabel * | label_info |
| GtkEntry * | file_entry |
| AudioResample< int16_le_t, int16_ne_t > * | resampler |
| int | fps |
| int16_t | temp [4 *DV_AUDIO_MAX_SAMPLES *2] |
| bool | wav_selected |
|
|
Definition at line 200 of file audio_filters.cc. References wav_file. 00200 : wav( NULL ), label_info( NULL ), file_entry( NULL ), resampler(0), wav_selected( false ) 00201 { 00202 strcpy( wav_file, "" ); 00203 }
|
|
|
Definition at line 205 of file audio_filters.cc. References resampler, and wav.
|
|
||||||||||||
|
Definition at line 332 of file audio_filters.cc. References KinoAudioInput::GetFrequency(), and wav. Referenced by AudioMix::GetFrame(), and AudioDub::GetFrame(). 00333 {
00334 return samples * wav->GetFrequency() / frequency;
00335 }
|
|
|
Definition at line 327 of file audio_filters.cc. References wav_selected. Referenced by AudioMix::GetFrame(), and AudioDub::GetFrame(). 00328 {
00329 return wav_selected;
00330 }
|
|
|
Definition at line 216 of file audio_filters.cc. References file_entry, and on_entry_file_changed(). Referenced by AudioDub::AudioDub(), and AudioMix::AudioMix(). 00217 {
00218 file_entry = entry;
00219 g_signal_connect( G_OBJECT( entry ), "changed", G_CALLBACK( on_entry_file_changed ), this );
00220 }
|
|
|
Definition at line 211 of file audio_filters.cc. References label_info. Referenced by AudioDub::AudioDub(), and AudioMix::AudioMix(). 00212 {
00213 label_info = label;
00214 }
|
|
|
Definition at line 222 of file audio_filters.cc. References KinoAudioInputFactory::CreateAudioInput(), file_entry, KinoAudioInput::GetFrequency(), KinoAudioInput::GetNumberOfSamples(), label_info, wav, wav_file, and wav_selected. Referenced by AudioDub::AudioDub(), and AudioMix::AudioMix(). 00223 {
00224 char text[ 10240 ] = "";
00225
00226 if ( strcmp( wav_file, gtk_entry_get_text( file_entry ) ) )
00227 {
00228 delete wav;
00229
00230 strcpy( wav_file, gtk_entry_get_text( file_entry ) );
00231 this->wav = KinoAudioInputFactory::CreateAudioInput( wav_file );
00232
00233 if ( wav != NULL )
00234 {
00235 wav_selected = true;
00236 if ( wav->GetNumberOfSamples() > 0 )
00237 {
00238 sprintf( text, _( "Duration: %.02f seconds" ),
00239 ( double ) wav->GetNumberOfSamples() / ( double ) wav->GetFrequency() );
00240 }
00241 else
00242 {
00243 sprintf( text, _( "Duration: N/A" ) );
00244 }
00245 }
00246 else
00247 {
00248 wav_selected = false;
00249 strcpy( text, _( "Invalid file selected" ) );
00250 }
00251 }
00252 else if ( !strcmp( wav_file, "" ) )
00253 {
00254 wav_selected = false;
00255 strcpy( text, _( "No file selected" ) );
00256 }
00257
00258 if ( strcmp( text, "" ) )
00259 gtk_label_set_text( label_info, text );
00260 }
|
|
|
Definition at line 337 of file audio_filters.cc. References KinoAudioInput::GetFrequency(), and wav. Referenced by AudioMix::GetFrame(), and AudioDub::GetFrame(). 00338 {
00339 return wav->GetFrequency();
00340 }
|
|
||||||||||||||||||||||||
|
Definition at line 292 of file audio_filters.cc. References KinoAudioInput::Get(), KinoAudioInput::GetFrequency(), resampler, temp, wav, and wav_selected. Referenced by AudioMix::GetFrame(), and AudioDub::GetFrame(). 00293 {
00294 if ( wav_selected )
00295 {
00296 if ( resampler )
00297 {
00298 memset( temp, 0, sizeof( temp ) );
00299 int samples = bytes / c / 2 * wav->GetFrequency() / f;
00300 bytes = samples * c * 2;
00301 if ( !wav->Get( temp, bytes ) )
00302 std::cerr << ">>> Underrun? unable to read " << bytes << " bytes" << std::endl;
00303
00304 resampler->Resample( reinterpret_cast<int16_le_t *>(temp), wav->GetFrequency(), c, samples );
00305
00306 int16_t *p = resampler->output;
00307 for ( int s = 0; s < resampler->size / c / 2; s ++ )
00308 for ( int i = 0; i < c; i ++ )
00309 a[ i ][ s ] = int16_t( double( *p++ ) * gain + 0.5 );
00310 return (resampler->size / c / 2);
00311 }
00312 else
00313 {
00314 memset( temp, 0, sizeof( temp ) );
00315 if ( !wav->Get( temp, bytes ) )
00316 std::cerr << ">>> Underrun? unable to read " << bytes << " bytes" << std::endl;
00317 int16_t *p = temp;
00318 for ( int s = 0; s < bytes / c / 2; s ++ )
00319 for ( int i = 0; i < c; i ++ )
00320 a[ i ][ s ] = int16_t( double( *p++ ) * gain + 0.5 );
00321 return (bytes / c / 2);
00322 }
00323 }
00324 return 0;
00325 }
|
|
||||||||||||||||
|
|
Definition at line 193 of file audio_filters.cc. Referenced by SetWavFileEntry(), and WavFileSelected(). |
|
|
Definition at line 195 of file audio_filters.cc. Referenced by WavStart(). |
|
|
Definition at line 192 of file audio_filters.cc. Referenced by SetWavInfoLabel(), and WavFileSelected(). |
|
|
Definition at line 194 of file audio_filters.cc. Referenced by WavRead(), WavStart(), and ~WavSelect(). |
|
|
Definition at line 196 of file audio_filters.cc. Referenced by WavRead(). |
|
|
Definition at line 191 of file audio_filters.cc. Referenced by GetAdjustedSamples(), WavFileSelected(), WavGetFrequency(), WavRead(), WavStart(), and ~WavSelect(). |
|
|
Definition at line 190 of file audio_filters.cc. Referenced by WavFileSelected(), WavSelect(), and WavStart(). |
|
|
Definition at line 197 of file audio_filters.cc. Referenced by IsSelected(), WavFileSelected(), WavRead(), and WavStart(). |
1.4.2