Changeset 1776

Show
Ignore:
Timestamp:
Thu Oct 27 17:22:40 2005
Author:
fgerlits
Message:

added keyboard shortcuts for play/pause/stop in the Master Panel;
removed stupid search function from Scratchpad and Live Mode (so that

now these windows can receive keyboard events [a-zA-Z]).
this fixes #1036 (except for fade, which may or may not be addressed later)

Files:

Legend:

Unmodified
Added
Removed
Modified
  • trunk/livesupport/src/products/gLiveSupport/src/LiveModeWindow.h

    r1752 r1776  
    182 182          *  The keys can be customized by the keyboardShortcutContainer  
    183 183          *  element in the gLiveSupport configuration file.  
    184            *  The actions handled are: moveItemUp, moveItemDown and removeItem.  
      184          *   
      185          *  The actions handled are: moveItemUp, moveItemDown, removeItem,  
      186          *  and playAudio (which plays the item in the output player).  
    185 187          *  
    186 188          *  @param  event the button event received  
  • trunk/livesupport/src/products/gLiveSupport/src/MasterPanelWindow.h

    r1601 r1776  
    359 359         }  
    360 360  
      361         /**  
      362          *  Signal handler for a key pressed at one of the entries.  
      363          *  The keys can be customized by the keyboardShortcutContainer  
      364          *  element in the gLiveSupport configuration file.  
      365          *  
      366          *  The action handled is: playAudio, pauseAudio, stopAudio,  
      367          *  and nextTrack.  
      368          *  
      369          *  @param  event the button event received  
      370          *  @return true if the key press was fully handled, false if not  
      371          */  
      372         bool  
      373         onKeyPressed(GdkEventKey *          event)              throw ();  
      374  
    361 375  
    362 376     public:  
  • trunk/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.h

    r1752 r1776  
    259 259          *  The keys can be customized by the keyboardShortcutContainer  
    260 260          *  element in the gLiveSupport configuration file.  
      261          *   
    261 262          *  The actions handled are: moveItemUp, moveItemDown and removeItem.  
    262 263          *  
  • trunk/livesupport/src/products/gLiveSupport/src/KeyboardShortcut.cxx

    r1747 r1776  
    285 285             return GDK_A + (c - 'A');  
    286 286         } else if (c >= 'a' && c <= 'z') {  
    287               return GDK_A + (c - 'a');  
      287             return GDK_a + (c - 'a');  
    287 287         }  
    288 288     } else if (*keyName == "Space") {  
  • trunk/livesupport/src/products/gLiveSupport/src/NowPlaying.h

    r1601 r1776  
    194 194         onUpdateTime(void)                              throw ();  
    195 195  
      196         /**  
      197          *  Public interface for restarting the audio.  
      198          *  
      199          *  This is used by MasterPanelWindow::onKeyPressed().  
      200          */  
      201         void  
      202         onPlayAudio(void)                               throw ()  
      203         {  
      204             onPlayButtonClicked();  
      205         }  
      206  
      207         /**  
      208          *  Public interface for pausing the audio.  
      209          *  
      210          *  This is used by MasterPanelWindow::onKeyPressed().  
      211          */  
      212         void  
      213         onPauseAudio(void)                              throw ()  
      214         {  
      215             onPauseButtonClicked();  
      216         }  
      217  
      218         /**  
      219          *  Public interface for stopping the audio.  
      220          *  
      221          *  This is used by MasterPanelWindow::onKeyPressed().  
      222          */  
      223         void  
      224         onStopAudio(void)                               throw ()  
      225         {  
      226             onStopButtonClicked();  
      227         }  
    196 228 };  
    197 229  
  • trunk/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.h

    r1752 r1776  
    157 157          *  The keys can be customized by the keyboardShortcutContainer  
    158 158          *  element in the gLiveSupport configuration file.  
      159          *   
    159 160          *  The actions handled are: moveItemUp, moveItemDown and removeItem.  
    160 161          *  
  • trunk/livesupport/src/products/gLiveSupport/src/LiveModeWindow.cxx

    r1752 r1776  
    96 96     treeView = Gtk::manage(wf->createTreeView(treeModel));  
    97 97     treeView->set_headers_visible(false);  
      98     treeView->set_enable_search(false);  
    98 99  
    99 100     // Add the TreeView's view columns:  
    363 364                                         return true;  
    364 365                  
      366                 case KeyboardShortcut::playAudio :  
      367                                         onOutputPlay();  
      368                                         return true;  
      369                  
    365 370                 default :               break;  
    366 371             }  
  • trunk/livesupport/src/products/gLiveSupport/src/MasterPanelWindow.cxx

    r1601 r1776  
    52 52 /* ================================================  local constants & macros */  
    53 53  
      54 /**  
      55  *  The name of the window, used by the keyboard shortcuts (or by the .gtkrc).  
      56  */  
      57 static const Glib::ustring  windowName = "masterPanelWindow";  
      58  
    54 59  
    55 60 /* ===============================================  local function prototypes */  
     
    156 161     add(*layout);  
    157 162  
      163     // register the signal handler for keyboard key presses  
      164     this->signal_key_press_event().connect(sigc::mem_fun(*this,  
      165                                         &MasterPanelWindow::onKeyPressed));  
      166  
    158 167     // set the background to white  
    159 168     bgColor = Colors::getColor(Colors::White);  
     
    169 178     move(0, 0);  
    170 179     set_decorated(false);  
      180     set_name(windowName);  
      181 // need to make it focusable first  
      182 //    set_focus(*nowPlayingWidget);  
    171 183  
    172 184     // set the localized resources  
     
    585 597 {  
    586 598     nowPlayingWidget->setPlayable(playable);  
      599     present();  // this moves the global keyboard focus to the master panel  
    587 600 }  
    588 601  
    613 626 }  
    614 627  
      628  
      629 /*------------------------------------------------------------------------------  
      630  *  Event handler for a key pressed.  
      631  *----------------------------------------------------------------------------*/  
      632 bool  
      633 MasterPanelWindow :: onKeyPressed(GdkEventKey *    event)           throw ()  
      634 {  
      635     if (event->type == GDK_KEY_PRESS) {  
      636         KeyboardShortcut::Action    action = gLiveSupport->findAction(  
      637                                                     windowName,  
      638                                                     event->state,  
      639                                                     event->keyval);  
      640         switch (action) {  
      641             case KeyboardShortcut::playAudio :  
      642                                     nowPlayingWidget->onPlayAudio();  
      643                                     return true;  
      644              
      645             case KeyboardShortcut::pauseAudio :  
      646                                     nowPlayingWidget->onPauseAudio();  
      647                                     return true;  
      648              
      649             case KeyboardShortcut::stopAudio :  
      650                                     nowPlayingWidget->onStopAudio();  
      651                                     return true;  
      652              
      653             case KeyboardShortcut::nextTrack :  
      654                                     gLiveSupport->stopOutputAudio();  
      655                                     gLiveSupport->onStop();  
      656                                     return true;  
      657              
      658             default :               break;  
      659         }  
      660     }  
      661      
      662     return false;  
      663 }  
      664  
  • trunk/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.cxx

    r1752 r1776  
    110 110     treeView = Gtk::manage(widgetFactory->createTreeView(treeModel));  
    111 111     treeView->get_selection()->set_mode(Gtk::SELECTION_MULTIPLE);  
      112     treeView->set_enable_search(false);  
    112 113  
    113 114     // Add the TreeView's view columns:  
  • trunk/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml

    r1752 r1776  
    337 337      
    338 338     <keyboardShortcutContainer>  
      339         <windowName>masterPanelWindow</windowName>  
      340         <keyboardShortcut>  
      341             <action>playAudio</action>  
      342             <key>x</key>  
      343             <key>X</key>  
      344             <key>Space</key>  
      345         </keyboardShortcut>  
      346         <keyboardShortcut>  
      347             <action>pauseAudio</action>  
      348             <key>v</key>  
      349             <key>V</key>  
      350         </keyboardShortcut>  
      351         <keyboardShortcut>  
      352             <action>stopAudio</action>  
      353             <key>c</key>  
      354             <key>C</key>  
      355         </keyboardShortcut>  
      356         <keyboardShortcut>  
      357             <action>nextTrack</action>  
      358             <key>b</key>  
      359             <key>B</key>  
      360         </keyboardShortcut>  
      361     </keyboardShortcutContainer>  
      362  
      363     <keyboardShortcutContainer>  
    339 364         <windowName>liveModeWindow</windowName>  
    340 365         <keyboardShortcut>  
    350 375             <key>Delete</key>  
    351 376         </keyboardShortcut>  
      377         <keyboardShortcut>  
      378             <action>playAudio</action>  
      379             <key>x</key>  
      380             <key>X</key>  
      381             <key>Space</key>  
      382         </keyboardShortcut>  
    352 383     </keyboardShortcutContainer>  
    353 384  
  • trunk/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml.user-template

    r1752 r1776  
    337 337      
    338 338     <keyboardShortcutContainer>  
      339         <windowName>masterPanelWindow</windowName>  
      340         <keyboardShortcut>  
      341             <action>playAudio</action>  
      342             <key>x</key>  
      343             <key>X</key>  
      344             <key>Space</key>  
      345         </keyboardShortcut>  
      346         <keyboardShortcut>  
      347             <action>pauseAudio</action>  
      348             <key>v</key>  
      349             <key>V</key>  
      350         </keyboardShortcut>  
      351         <keyboardShortcut>  
      352             <action>stopAudio</action>  
      353             <key>c</key>  
      354             <key>C</key>  
      355         </keyboardShortcut>  
      356         <keyboardShortcut>  
      357             <action>nextTrack</action>  
      358             <key>b</key>  
      359             <key>B</key>  
      360         </keyboardShortcut>  
      361     </keyboardShortcutContainer>  
      362  
      363     <keyboardShortcutContainer>  
    339 364         <windowName>liveModeWindow</windowName>  
    340 365         <keyboardShortcut>  
    350 375             <key>Delete</key>  
    351 376         </keyboardShortcut>  
      377         <keyboardShortcut>  
      378             <action>playAudio</action>  
      379             <key>x</key>  
      380             <key>X</key>  
      381             <key>Space</key>  
      382         </keyboardShortcut>  
    352 383     </keyboardShortcutContainer>  
    353 384  
  • trunk/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml.template

    r1752 r1776  
    337 337      
    338 338     <keyboardShortcutContainer>  
      339         <windowName>masterPanelWindow</windowName>  
      340         <keyboardShortcut>  
      341             <action>playAudio</action>  
      342             <key>x</key>  
      343             <key>X</key>  
      344             <key>Space</key>  
      345         </keyboardShortcut>  
      346         <keyboardShortcut>  
      347             <action>pauseAudio</action>  
      348             <key>v</key>  
      349             <key>V</key>  
      350         </keyboardShortcut>  
      351         <keyboardShortcut>  
      352             <action>stopAudio</action>  
      353             <key>c</key>  
      354             <key>C</key>  
      355         </keyboardShortcut>  
      356         <keyboardShortcut>  
      357             <action>nextTrack</action>  
      358             <key>b</key>  
      359             <key>B</key>  
      360         </keyboardShortcut>  
      361     </keyboardShortcutContainer>  
      362  
      363     <keyboardShortcutContainer>  
    339 364         <windowName>liveModeWindow</windowName>  
    340 365         <keyboardShortcut>  
    350 375             <key>Delete</key>  
    351 376         </keyboardShortcut>  
      377         <keyboardShortcut>  
      378             <action>playAudio</action>  
      379             <key>x</key>  
      380             <key>X</key>  
      381             <key>Space</key>  
      382         </keyboardShortcut>  
    352 383     </keyboardShortcutContainer>  
    353 384