#include <audio_filters.h>
Inheritance diagram for GDKAudioFilterRepository:


Public Member Functions | |
| GDKAudioFilterRepository () | |
| Constructor for the audio filter repository. | |
| ~GDKAudioFilterRepository () | |
| Destructor for the image repository - clears all the registered filters. | |
| void | Register (GDKAudioFilter *filter) |
| Register an audio filter. | |
| void | Initialise (GtkOptionMenu *menu, GtkBin *container) |
| Initialise the option menu with the current list of registered filters. | |
| GDKAudioFilter * | Get () const |
| Get the currently selected audio filter. | |
| void | SelectionChange () |
| Handle attach/detach widgets on last selected/selected items. | |
Private Attributes | |
| vector< GDKAudioFilter * > | filters |
| GDKAudioFilter * | selected_filter |
| GtkOptionMenu * | menu |
| GtkBin * | container |
Filters are currently registered in the repositories constructor and added to the OptionMenu provided via the Initialise function.
Additional filters can be registered before an Initialise call (using the Register method), and Initialise can be called many times if necessary.
The Initialise method is called with the menu to contain the selectable entries and a container for the filter specific widget handling.
Definition at line 111 of file audio_filters.h.
|
|
Constructor for the audio filter repository. Registers an instance of each known filter for later GUI exposure via the Initialise method. Definition at line 574 of file audio_filters.cc. References Register(). 00574 : selected_filter( NULL ), menu( NULL ), container( NULL ) 00575 { 00576 // Register an instance of each object (adapting raw filters to GDK filters where necessary) 00577 Register( new GDKAudioFilterAdapter( new AudioFilterKeep() ) ); 00578 Register( new AudioDub() ); 00579 Register( new GDKAudioFilterAdapter( new AudioFilterFadeIn() ) ); 00580 Register( new GDKAudioFilterAdapter( new AudioFilterFadeOut() ) ); 00581 Register( new AudioGain() ); 00582 Register( new AudioMix() ); 00583 Register( new GDKAudioFilterAdapter( new AudioFilterSilence() ) ); 00584 }
|
|
|
Destructor for the image repository - clears all the registered filters.
Definition at line 589 of file audio_filters.cc. References filters. 00590 {
00591 // Remove the filters in the repository
00592 for ( unsigned int index = 0; index < filters.size(); index ++ )
00593 delete filters[ index ];
00594 }
|
|
|
Get the currently selected audio filter.
Definition at line 633 of file audio_filters.cc. Referenced by PageMagick::GetAudioFilter(), and SelectionChange(). 00634 {
00635 GtkMenu * filterMenu = GTK_MENU( gtk_option_menu_get_menu( menu ) );
00636 GtkWidget *active_item = gtk_menu_get_active( filterMenu );
00637 return filters[ g_list_index( GTK_MENU_SHELL( filterMenu ) ->children, active_item ) ];
00638 }
|
|
||||||||||||
|
Initialise the option menu with the current list of registered filters.
Definition at line 608 of file audio_filters.cc. References filters, on_optionmenu_selected(), and SelectionChange(). Referenced by PageMagick::PageMagick(). 00609 {
00610 // Store these for future reference
00611 this->menu = menu;
00612 this->container = container;
00613
00614 // Add the filters to the menu
00615 GtkMenu *menu_new = GTK_MENU( gtk_menu_new( ) );
00616 for ( unsigned int index = 0; index < filters.size(); index ++ )
00617 {
00618 GtkWidget *item = gtk_menu_item_new_with_label( filters[ index ] ->GetDescription( ) );
00619 gtk_widget_show( item );
00620 gtk_menu_append( menu_new, item );
00621 g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( on_optionmenu_selected ), this );
00622 }
00623 gtk_menu_set_active( menu_new, 0 );
00624 gtk_option_menu_set_menu( menu, GTK_WIDGET( menu_new ) );
00625
00626 // Register the selected items widgets
00627 SelectionChange();
00628 }
|
|
|
Register an audio filter.
Definition at line 599 of file audio_filters.cc. References filters, and AudioFilter::GetDescription(). Referenced by GDKAudioFilterRepository(), and PluginAudioFilterRepository::InstallPlugins(). 00600 {
00601 std::cerr << ">>> Audio Filter: " << filter->GetDescription() << std::endl;
00602 filters.push_back( filter );
00603 }
|
|
|
Handle attach/detach widgets on last selected/selected items.
Definition at line 643 of file audio_filters.cc. References GDKAudioFilter::AttachWidgets(), common, container, GDKAudioFilter::DetachWidgets(), Get(), KinoCommon::getPageMagick(), PageMagick::IsPreviewing(), selected_filter, and PageMagick::StopPreview(). Referenced by Initialise(). 00644 {
00645 bool isPreviewing = false;
00646 PageMagick* magick = 0;
00647
00648 if ( common && common->getPageMagick( ) )
00649 magick = common->getPageMagick( );
00650 if ( magick && magick->IsPreviewing() )
00651 {
00652 isPreviewing = true;
00653 magick->StopPreview();
00654 }
00655
00656 // Detach the selected filters widgets
00657 if ( selected_filter != NULL )
00658 selected_filter->DetachWidgets( container );
00659
00660 // Get the new selection
00661 selected_filter = Get();
00662
00663 // Attach the new filters widgets
00664 if ( selected_filter != NULL )
00665 selected_filter->AttachWidgets( container );
00666
00667 if ( magick )
00668 {
00669 if ( isPreviewing )
00670 magick->StartPreview();
00671 else
00672 magick->PreviewFrame();
00673 }
00674 }
|
|
|
Definition at line 117 of file audio_filters.h. Referenced by SelectionChange(). |
|
|
Definition at line 114 of file audio_filters.h. Referenced by Get(), Initialise(), Register(), and ~GDKAudioFilterRepository(). |
|
|
Definition at line 116 of file audio_filters.h. Referenced by Get(). |
|
|
Definition at line 115 of file audio_filters.h. Referenced by SelectionChange(). |
1.4.2