Changeset 488

Show
Ignore:
Timestamp:
09/17/08 08:31:35 (5 years ago)
Author:
wolke
Message:

code clean up

Location:
branches/audiofilebrowser/gui/src/AudioFileBrowser
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/audiofilebrowser/gui/src/AudioFileBrowser/AudioFileBrowser.cpp

    r487 r488  
    2626#include "InstrumentEditor/InstrumentEditor.h" 
    2727#include "SampleWaveDisplay.h" 
    28  
    29 #include <hydrogen/LocalFileMng.h> 
     28#include "../widgets/Button.h" 
     29 
    3030#include <hydrogen/h2_exception.h> 
    3131#include <hydrogen/Preferences.h> 
    32 #include <hydrogen/hydrogen.h> 
    3332#include <hydrogen/sample.h> 
    34 //#include <hydrogen/sampler/Sampler.h> 
    3533#include <hydrogen/audio_engine.h> 
    3634 
    37 #include "../widgets/Button.h" 
    38  
    3935#include <QTreeWidget> 
    40 #include <QDomDocument> 
    4136#include <QMessageBox> 
    42 #include <QHeaderView> 
    43 #include <QFileDialog> 
    44 #include <vector> 
    45 #include <cstdlib> 
    46 #include <iostream> 
    47 #include <fstream> 
    4837 
    4938using namespace H2Core; 
     
    6150        installEventFilter(this); 
    6251 
    63         QDir lastsampleDirectory =  Preferences::getInstance()->__lastsampleDirectory; 
    64  
    6552 
    6653        model = new QDirModel(); 
     
    7259        openBTN->setEnabled( false ); 
    7360 
    74 //      namelabel->setText(model->headerData()); 
    7561        tree = new QTreeView(treeView); 
    7662        tree->setModel(model); 
     
    8773        m_pSampleWaveDisplay->move( 3, 3 ); 
    8874 
    89         connect(tree, SIGNAL(clicked(const QModelIndex&)), SLOT(clicked(const QModelIndex&))); 
    90         connect(pathLineEdit, SIGNAL( returnPressed() ), SLOT( updateModelIndex( ) )); 
     75        connect( tree, SIGNAL( clicked( const QModelIndex&) ), SLOT( clicked( const QModelIndex&) ) ); 
     76        connect( pathLineEdit, SIGNAL( returnPressed() ), SLOT( updateModelIndex() ) ); 
    9177 
    9278//      QTimer *timer = new QTimer( this ); 
     
    125111        QString onlypath = path; 
    126112        if (name != ""){ 
    127                 onlypath = path.replace( name, ""); 
     113                onlypath = path.replace( name, "" ); 
    128114        } 
    129115                 
    130         name = name.left('.'); 
     116        name = name.left( '.' ); 
    131117 
    132118        QString message = "Name: " + name; 
    133         filelineedit->setText(path2); 
    134         pathLineEdit->setText(onlypath); 
     119        filelineedit->setText( path2 ); 
     120        pathLineEdit->setText( onlypath ); 
    135121 
    136122 
     
    151137                                m_pNBytesLable->setText( trUtf8( "Size: %1 bytes" ).arg( pNewSample->get_size() / 2 ) ); 
    152138                                m_pSamplerateLable->setText( trUtf8( "Samplerate: %1" ).arg( pNewSample->get_sample_rate() ) ); 
    153                                 float sec = (float)(pNewSample->get_n_frames() / (float)pNewSample->get_sample_rate()); 
     139                                float sec = ( float )( pNewSample->get_n_frames() / (float)pNewSample->get_sample_rate() ); 
    154140                                QString qsec = ""; 
    155                                 qsec.sprintf("%2.2f",sec); 
     141                                qsec.sprintf( "%2.2f", sec ); 
    156142                                m_pLengthLable->setText( trUtf8( "Samplelength: " ) + qsec + trUtf8( " s" ) ); 
    157143 
  • branches/audiofilebrowser/gui/src/AudioFileBrowser/AudioFileBrowser.h

    r484 r488  
    2525 
    2626#include "config.h" 
     27#include "ui_AudioFileBrowser_UI.h" 
     28#include "InstrumentEditor/InstrumentEditor.h" 
    2729 
    2830#include <QDialog> 
    29 #include "ui_AudioFileBrowser_UI.h" 
    3031#include <hydrogen/Object.h> 
    3132#include <hydrogen/Preferences.h> 
    32 #include <hydrogen/hydrogen.h> 
    33 #include "InstrumentEditor/InstrumentEditor.h" 
     33 
    3434 
    3535class Button; 
     
    5555                void on_cancelBTN_clicked(); 
    5656                void on_openBTN_clicked(); 
    57                 void clicked(const QModelIndex& index); 
     57                void clicked( const QModelIndex& index ); 
    5858                void on_m_pPlayBtn_clicked(); 
    5959                void updateModelIndex(); 
  • branches/audiofilebrowser/gui/src/AudioFileBrowser/AudioFileBrowser_UI.ui

    r483 r488  
    167167   </property> 
    168168  </widget> 
    169   <widget class="QWidget" name="" > 
     169  <widget class="QWidget" name="layoutWidget" > 
    170170   <property name="geometry" > 
    171171    <rect> 
     
    173173     <y>10</y> 
    174174     <width>801</width> 
    175      <height>27</height> 
     175     <height>28</height> 
    176176    </rect> 
    177177   </property> 
     
    187187     </widget> 
    188188    </item> 
     189    <item> 
     190     <widget class="QPushButton" name="m_pPathHometoolButton" > 
     191      <property name="text" > 
     192       <string>Home</string> 
     193      </property> 
     194     </widget> 
     195    </item> 
    189196   </layout> 
    190197  </widget> 
     
    192199 <tabstops> 
    193200  <tabstop>pathLineEdit</tabstop> 
    194   <tabstop>m_pPathUptoolButton</tabstop> 
    195201  <tabstop>treeView</tabstop> 
    196202  <tabstop>filelineedit</tabstop>