Changeset 605

Show
Ignore:
Timestamp:
10/30/08 12:40:42 (5 years ago)
Author:
wolke
Message:

add new sampleeditor files

Location:
branches/new_fx_rack_and_sample_fun/gui/src
Files:
3 added
4 modified

Legend:

Unmodified
Added
Removed
  • branches/new_fx_rack_and_sample_fun/gui/src/HydrogenApp.cpp

    r570 r605  
    3838#include "SongEditor/SongEditorPanel.h" 
    3939#include "PlaylistEditor/PlaylistDialog.h" 
    40 //#include "AudioFileBrowser/AudioFileBrowser.h" 
     40#include "SampleEditor/SampleEditor.h" 
    4141 
    4242#include "Mixer/Mixer.h" 
     
    6666 , m_pPlayerControl( NULL ) 
    6767 , m_pPlaylistDialog( NULL ) 
    68 // , m_pAudioFileBrowser( NULL ) 
     68 , m_pSampleEditor( NULL ) 
    6969 
    7070{ 
     
    100100        } 
    101101         
    102          m_pPlaylistDialog = new PlaylistDialog( 0 ); 
    103 //       m_pAudioFileBrowser = new AudioFileBrowser( 0 ); 
     102        m_pPlaylistDialog = new PlaylistDialog( 0 ); 
     103//      m_pSampleEditor = new SampleEditor( 0 ); 
    104104         
    105105        showInfoSplash();       // First time information 
     
    117117        delete m_pMixer; 
    118118        delete m_pPlaylistDialog; 
    119 //      delete m_pAudioFileBrowser; 
     119        delete m_pSampleEditor; 
    120120 
    121121        Hydrogen *engine = Hydrogen::get_instance(); 
     
    132132        } 
    133133        #endif 
     134 
     135         
    134136} 
    135137 
     
    250252} 
    251253 
     254 
     255 
    252256void HydrogenApp::setSong(Song* song) 
    253257{ 
     
    316320} 
    317321 
    318 //void HydrogenApp::showAudioFileBrowser() 
    319 //{ 
    320 //      m_pAudioFileBrowser->hide(); 
    321 //      m_pAudioFileBrowser->show(); 
    322 //} 
     322 
     323 
     324void HydrogenApp::showSampleEditor( QString name ) 
     325{ 
     326        if ( m_pSampleEditor ){ 
     327                if ( m_pSampleEditor->m_pSampleEditorStatus == false ){ 
     328                        m_pSampleEditor->show(); 
     329                        bool close = m_pSampleEditor->getCloseQuestion(); 
     330                        if ( close ){ 
     331                                delete m_pSampleEditor; 
     332                        }else 
     333                        { 
     334                                return; 
     335                        } 
     336                }else 
     337                { 
     338                        delete m_pSampleEditor; 
     339                } 
     340        } 
     341         
     342        m_pSampleEditor = new SampleEditor( 0 ); 
     343        m_pSampleEditor->show(); 
     344        m_pSampleEditor->setSampleName( name ); 
     345} 
     346 
     347 
    323348 
    324349void HydrogenApp::showInfoSplash() 
  • branches/new_fx_rack_and_sample_fun/gui/src/HydrogenApp.h

    r570 r605  
    5454class InstrumentRack; 
    5555class PlaylistDialog; 
    56 //class AudioFileBrowser; 
     56class SampleEditor; 
    5757 
    5858class HydrogenApp : public QObject, public Object 
     
    7373                void showAudioEngineInfoForm(); 
    7474                void showPlaylistDialog(); 
    75 //              void showAudioFileBrowser(); 
     75                void showSampleEditor( QString name ); 
    7676 
    7777                Mixer* getMixer() {     return m_pMixer;        } 
     
    8080                AudioEngineInfoForm* getAudioEngineInfoForm() { return m_pAudioEngineInfoForm;  } 
    8181                PlaylistDialog* getPlayListDialog() {   return m_pPlaylistDialog;       } 
    82 //              AudioFileBrowser* getAudioFileBrowser() {  return m_pAudioFileBrowser;  } 
     82                SampleEditor* getSampleEditor() {  return m_pSampleEditor;      } 
    8383                SimpleHTMLBrowser* getHelpBrowser() {   return m_pHelpBrowser;  } 
    8484                PatternEditorPanel* getPatternEditorPanel() {   return m_pPatternEditorPanel;   } 
     
    108108                LadspaFXProperties *m_pLadspaFXProperties[MAX_FX]; 
    109109#endif 
    110  
    111110                MainForm *m_pMainForm; 
    112111                Mixer *m_pMixer; 
     
    119118                PlayerControl *m_pPlayerControl; 
    120119                PlaylistDialog *m_pPlaylistDialog; 
    121 //              AudioFileBrowser *m_pAudioFileBrowser; 
     120                SampleEditor *m_pSampleEditor; 
    122121 
    123122                QTimer *m_pEventQueueTimer; 
  • branches/new_fx_rack_and_sample_fun/gui/src/InstrumentEditor/InstrumentEditor.cpp

    r599 r605  
    216216        ); 
    217217 
     218        m_pSamleEditorBtn = new Button( 
     219                        m_pLayerProp, 
     220                        "/instrumentEditor/deleteLayer_on.png", 
     221                        "/instrumentEditor/deleteLayer_off.png", 
     222                        "/instrumentEditor/deleteLayer_over.png", 
     223                        QSize( 60, 13 ) 
     224        ); 
     225 
     226 
     227 
    218228        m_pLoadLayerBtn->move( 48, 267 ); 
    219229        m_pRemoveLayerBtn->move( 145, 267 ); 
     230        m_pSamleEditorBtn->move( 200, 267 ); 
    220231 
    221232        connect( m_pLoadLayerBtn, SIGNAL( clicked(Button*) ), this, SLOT( buttonClicked(Button*) ) ); 
    222233        connect( m_pRemoveLayerBtn, SIGNAL( clicked(Button*) ), this, SLOT( buttonClicked(Button*) ) ); 
    223  
     234        connect( m_pSamleEditorBtn, SIGNAL( clicked(Button*) ), this, SLOT( buttonClicked(Button*) ) ); 
    224235        // Layer gain 
    225236        m_pLayerGainLCD = new LCDDisplay( m_pLayerProp, LCDDigit::SMALL_BLUE, 4 ); 
     
    476487                m_pLayerPreview->updateAll(); 
    477488        } 
     489        else if ( pButton == m_pSamleEditorBtn ){ 
     490                if ( m_pInstrument ) { 
     491                        H2Core::InstrumentLayer *pLayer = m_pInstrument->get_layer( m_nSelectedLayer ); 
     492                        if ( pLayer ) { 
     493                                QString name = pLayer->get_sample()->get_filename(); 
     494                                HydrogenApp::getInstance()->showSampleEditor( name ); 
     495                        } 
     496                } 
     497                 
     498        } 
    478499        else { 
    479500                ERRORLOG( "[buttonClicked] unhandled button" ); 
  • branches/new_fx_rack_and_sample_fun/gui/src/InstrumentEditor/InstrumentEditor.h

    r581 r605  
    121121                Button *m_pLoadLayerBtn; 
    122122                Button *m_pRemoveLayerBtn; 
     123                Button *m_pSamleEditorBtn; 
    123124                //~ Layer properties 
    124125