Changeset 438

Show
Ignore:
Timestamp:
09/06/08 15:14:12 (5 years ago)
Author:
comix
Message:

Buf fix: #30 (Crash after installing a new drumkit)

Location:
trunk/gui/src/SoundLibrary
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/gui/src/SoundLibrary/SoundLibraryPanel.cpp

    r422 r438  
    4141#include "../InstrumentRack.h" 
    4242 
    43 #include <hydrogen/LocalFileMng.h> 
     43#include <hydrogen/adsr.h> 
     44#include <hydrogen/audio_engine.h> 
    4445#include <hydrogen/data_path.h> 
    45 #include <hydrogen/sample.h> 
    46 #include <hydrogen/adsr.h> 
     46#include <hydrogen/h2_exception.h> 
    4747#include <hydrogen/hydrogen.h> 
    4848#include <hydrogen/instrument.h> 
    49 #include <hydrogen/h2_exception.h> 
    50 #include <hydrogen/audio_engine.h> 
     49#include <hydrogen/LocalFileMng.h> 
    5150#include <hydrogen/Preferences.h> 
    5251#include <hydrogen/Pattern.h> 
     52#include <hydrogen/sample.h> 
     53#include <hydrogen/Song.h> 
     54#include <hydrogen/SoundLibrary.h> 
     55 
    5356using namespace H2Core; 
    5457 
     
    5861 : QWidget( pParent ) 
    5962 , Object( "SoundLibraryPanel" ) 
     63 , m_pSoundLibraryTree( NULL ) 
     64 , m_pDrumkitMenu( NULL ) 
     65 , m_pInstrumentMenu( NULL ) 
     66 , m_pSongMenu( NULL ) 
     67 , m_pPatternMenu( NULL ) 
     68 , m_pPatternMenuList( NULL ) 
     69 , m_pSystemDrumkitsItem( NULL ) 
     70 , m_pUserDrumkitsItem( NULL ) 
     71 , m_pSongItem( NULL ) 
     72 , m_pPatternItem( NULL ) 
     73 , m_pPatternItemList( NULL ) 
    6074{ 
    6175        //INFOLOG( "INIT" ); 
    62  
    6376        m_pDrumkitMenu = new QMenu( this ); 
    6477        m_pDrumkitMenu->addAction( trUtf8( "Load" ), this, SLOT( on_drumkitLoadAction() ) ); 
     
    746759void SoundLibraryPanel::test_expandedItems() 
    747760{ 
     761        assert( m_pSoundLibraryTree ); 
    748762        expandsongslist = m_pSoundLibraryTree->isItemExpanded( m_pSongItem ); 
    749763        expandpatternlist = m_pSoundLibraryTree->isItemExpanded( m_pPatternItem ); 
  • trunk/gui/src/SoundLibrary/SoundLibraryPanel.h

    r422 r438  
    3030#include <vector> 
    3131 
    32 #include <hydrogen/Song.h> 
    3332#include <hydrogen/Object.h> 
    34 #include <hydrogen/SoundLibrary.h> 
     33 
     34namespace H2Core 
     35{ 
     36        class Song; 
     37        class Drumkit; 
     38        class SoundLibrary; 
     39} 
    3540 
    3641class SoundLibraryTree; 
     
    3944class SoundLibraryPanel : public QWidget, private Object 
    4045{ 
    41         Q_OBJECT 
    42         public: 
    43                 SoundLibraryPanel( QWidget *pParent ); 
    44                 ~SoundLibraryPanel(); 
     46Q_OBJECT 
     47public: 
     48        SoundLibraryPanel( QWidget *pParent ); 
     49        ~SoundLibraryPanel(); 
    4550 
    46                 void updateDrumkitList(); 
    47                 void test_expandedItems(); 
     51        void updateDrumkitList(); 
     52        void test_expandedItems(); 
    4853 
    49         private slots: 
    50                 void on_DrumkitList_ItemChanged( QTreeWidgetItem * current, QTreeWidgetItem * previous ); 
    51                 void on_DrumkitList_itemActivated( QTreeWidgetItem * item, int column ); 
    52                 void on_DrumkitList_leftClicked( QPoint pos ); 
    53                 void on_DrumkitList_rightClicked( QPoint pos ); 
    54                 void on_DrumkitList_mouseMove( QMouseEvent *event ); 
     54private slots: 
     55        void on_DrumkitList_ItemChanged( QTreeWidgetItem * current, QTreeWidgetItem * previous ); 
     56        void on_DrumkitList_itemActivated( QTreeWidgetItem * item, int column ); 
     57        void on_DrumkitList_leftClicked( QPoint pos ); 
     58        void on_DrumkitList_rightClicked( QPoint pos ); 
     59        void on_DrumkitList_mouseMove( QMouseEvent *event ); 
    5560 
    56                 void on_drumkitLoadAction(); 
    57                 void on_drumkitDeleteAction(); 
    58                 void on_drumkitPropertiesAction(); 
    59                 void on_drumkitExportAction(); 
    60                 void on_instrumentDeleteAction(); 
    61                 void on_songLoadAction(); 
    62                 void on_patternLoadAction(); 
    63                 void on_patternDeleteAction(); 
     61        void on_drumkitLoadAction(); 
     62        void on_drumkitDeleteAction(); 
     63        void on_drumkitPropertiesAction(); 
     64        void on_drumkitExportAction(); 
     65        void on_instrumentDeleteAction(); 
     66        void on_songLoadAction(); 
     67        void on_patternLoadAction(); 
     68        void on_patternDeleteAction(); 
    6469 
    65         private: 
    66                 SoundLibraryTree *m_pSoundLibraryTree; 
    67                 //FileBrowser *m_pFileBrowser; 
     70private: 
     71        SoundLibraryTree *m_pSoundLibraryTree; 
     72        //FileBrowser *m_pFileBrowser; 
    6873 
    69                 QPoint m_startDragPosition; 
    70                 QMenu* m_pDrumkitMenu; 
    71                 QMenu* m_pInstrumentMenu; 
    72                 QMenu* m_pSongMenu; 
    73                 QMenu* m_pPatternMenu; 
    74                 QMenu* m_pPatternMenuList; 
     74        QPoint m_startDragPosition; 
     75        QMenu* m_pDrumkitMenu; 
     76        QMenu* m_pInstrumentMenu; 
     77        QMenu* m_pSongMenu; 
     78        QMenu* m_pPatternMenu; 
     79        QMenu* m_pPatternMenuList; 
    7580 
    76                 QTreeWidgetItem* m_pSystemDrumkitsItem; 
    77                 QTreeWidgetItem* m_pUserDrumkitsItem; 
    78                 QTreeWidgetItem* m_pSongItem; 
    79                 QTreeWidgetItem* m_pPatternItem; 
    80                 QTreeWidgetItem* m_pPatternItemList; 
     81        QTreeWidgetItem* m_pSystemDrumkitsItem; 
     82        QTreeWidgetItem* m_pUserDrumkitsItem; 
     83        QTreeWidgetItem* m_pSongItem; 
     84        QTreeWidgetItem* m_pPatternItem; 
     85        QTreeWidgetItem* m_pPatternItemList; 
    8186 
    82                 std::vector<H2Core::Drumkit*> m_systemDrumkitInfoList; 
    83                 std::vector<H2Core::Drumkit*> m_userDrumkitInfoList; 
    84                 bool expandpatternlist; 
    85                 bool expandsongslist; 
    86          
    87  
    88  
     87        std::vector<H2Core::Drumkit*> m_systemDrumkitInfoList; 
     88        std::vector<H2Core::Drumkit*> m_userDrumkitInfoList; 
     89        bool expandpatternlist; 
     90        bool expandsongslist; 
    8991}; 
    9092