Changeset 488
- Timestamp:
- 09/17/08 08:31:35 (5 years ago)
- Location:
- branches/audiofilebrowser/gui/src/AudioFileBrowser
- Files:
-
- 3 modified
-
AudioFileBrowser.cpp (modified) (6 diffs)
-
AudioFileBrowser.h (modified) (2 diffs)
-
AudioFileBrowser_UI.ui (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/audiofilebrowser/gui/src/AudioFileBrowser/AudioFileBrowser.cpp
r487 r488 26 26 #include "InstrumentEditor/InstrumentEditor.h" 27 27 #include "SampleWaveDisplay.h" 28 29 #include <hydrogen/LocalFileMng.h> 28 #include "../widgets/Button.h" 29 30 30 #include <hydrogen/h2_exception.h> 31 31 #include <hydrogen/Preferences.h> 32 #include <hydrogen/hydrogen.h>33 32 #include <hydrogen/sample.h> 34 //#include <hydrogen/sampler/Sampler.h>35 33 #include <hydrogen/audio_engine.h> 36 34 37 #include "../widgets/Button.h"38 39 35 #include <QTreeWidget> 40 #include <QDomDocument>41 36 #include <QMessageBox> 42 #include <QHeaderView>43 #include <QFileDialog>44 #include <vector>45 #include <cstdlib>46 #include <iostream>47 #include <fstream>48 37 49 38 using namespace H2Core; … … 61 50 installEventFilter(this); 62 51 63 QDir lastsampleDirectory = Preferences::getInstance()->__lastsampleDirectory;64 65 52 66 53 model = new QDirModel(); … … 72 59 openBTN->setEnabled( false ); 73 60 74 // namelabel->setText(model->headerData());75 61 tree = new QTreeView(treeView); 76 62 tree->setModel(model); … … 87 73 m_pSampleWaveDisplay->move( 3, 3 ); 88 74 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() ) ); 91 77 92 78 // QTimer *timer = new QTimer( this ); … … 125 111 QString onlypath = path; 126 112 if (name != ""){ 127 onlypath = path.replace( name, "" );113 onlypath = path.replace( name, "" ); 128 114 } 129 115 130 name = name.left( '.');116 name = name.left( '.' ); 131 117 132 118 QString message = "Name: " + name; 133 filelineedit->setText( path2);134 pathLineEdit->setText( onlypath);119 filelineedit->setText( path2 ); 120 pathLineEdit->setText( onlypath ); 135 121 136 122 … … 151 137 m_pNBytesLable->setText( trUtf8( "Size: %1 bytes" ).arg( pNewSample->get_size() / 2 ) ); 152 138 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() ); 154 140 QString qsec = ""; 155 qsec.sprintf( "%2.2f",sec);141 qsec.sprintf( "%2.2f", sec ); 156 142 m_pLengthLable->setText( trUtf8( "Samplelength: " ) + qsec + trUtf8( " s" ) ); 157 143 -
branches/audiofilebrowser/gui/src/AudioFileBrowser/AudioFileBrowser.h
r484 r488 25 25 26 26 #include "config.h" 27 #include "ui_AudioFileBrowser_UI.h" 28 #include "InstrumentEditor/InstrumentEditor.h" 27 29 28 30 #include <QDialog> 29 #include "ui_AudioFileBrowser_UI.h"30 31 #include <hydrogen/Object.h> 31 32 #include <hydrogen/Preferences.h> 32 #include <hydrogen/hydrogen.h> 33 #include "InstrumentEditor/InstrumentEditor.h" 33 34 34 35 35 class Button; … … 55 55 void on_cancelBTN_clicked(); 56 56 void on_openBTN_clicked(); 57 void clicked( const QModelIndex& index);57 void clicked( const QModelIndex& index ); 58 58 void on_m_pPlayBtn_clicked(); 59 59 void updateModelIndex(); -
branches/audiofilebrowser/gui/src/AudioFileBrowser/AudioFileBrowser_UI.ui
r483 r488 167 167 </property> 168 168 </widget> 169 <widget class="QWidget" name=" " >169 <widget class="QWidget" name="layoutWidget" > 170 170 <property name="geometry" > 171 171 <rect> … … 173 173 <y>10</y> 174 174 <width>801</width> 175 <height>2 7</height>175 <height>28</height> 176 176 </rect> 177 177 </property> … … 187 187 </widget> 188 188 </item> 189 <item> 190 <widget class="QPushButton" name="m_pPathHometoolButton" > 191 <property name="text" > 192 <string>Home</string> 193 </property> 194 </widget> 195 </item> 189 196 </layout> 190 197 </widget> … … 192 199 <tabstops> 193 200 <tabstop>pathLineEdit</tabstop> 194 <tabstop>m_pPathUptoolButton</tabstop>195 201 <tabstop>treeView</tabstop> 196 202 <tabstop>filelineedit</tabstop>