git-svn-id: https://svn.code.sf.net/p/pianobooster/code/trunk@58 ba081f5d-443b-49a7-ac4b-446c3f91f371
This commit is contained in:
parent
2efcfed942
commit
25d2ae9db3
|
@ -12,6 +12,7 @@ Piano Booster To Do tasks (in no particular order)
|
||||||
- Add - one finger play - playing just one note of a cord will be accepted (Optional
|
- Add - one finger play - playing just one note of a cord will be accepted (Optional
|
||||||
- Add - rhythm practice - any note played at the right time will be accepted
|
- Add - rhythm practice - any note played at the right time will be accepted
|
||||||
|
|
||||||
|
|
||||||
======== MEDIUM ========
|
======== MEDIUM ========
|
||||||
|
|
||||||
- Adding a high score of your playing ability.
|
- Adding a high score of your playing ability.
|
||||||
|
@ -25,6 +26,8 @@ Piano Booster To Do tasks (in no particular order)
|
||||||
- Display note durations as a piano roll type display.
|
- Display note durations as a piano roll type display.
|
||||||
- Display note duration using simple musical notation (without any rests or note beams)
|
- Display note duration using simple musical notation (without any rests or note beams)
|
||||||
- Automatically adjust the speed (as an option) to match the playing ability.
|
- Automatically adjust the speed (as an option) to match the playing ability.
|
||||||
|
- Adding a metronome/drum track to the piece being played.
|
||||||
|
- read the midi file tracks (at present the tracks are split only by midi channel number)
|
||||||
|
|
||||||
|
|
||||||
======== DIFFICULT ========
|
======== DIFFICULT ========
|
||||||
|
|
|
@ -18,6 +18,7 @@ ADD_DEFINITIONS(-Wall)
|
||||||
# by default only QtCore and QtGui modules are enabled
|
# by default only QtCore and QtGui modules are enabled
|
||||||
# other modules must be enabled like this:
|
# other modules must be enabled like this:
|
||||||
SET(QT_USE_QTOPENGL TRUE)
|
SET(QT_USE_QTOPENGL TRUE)
|
||||||
|
SET(QT_USE_QTXML TRUE)
|
||||||
|
|
||||||
|
|
||||||
FIND_PACKAGE( OpenGL REQUIRED )
|
FIND_PACKAGE( OpenGL REQUIRED )
|
||||||
|
@ -88,6 +89,7 @@ SET( PIANOBOOSTER_SRCS
|
||||||
TrackList.cpp
|
TrackList.cpp
|
||||||
Rating.cpp
|
Rating.cpp
|
||||||
Bar.cpp
|
Bar.cpp
|
||||||
|
Settings.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ GuiKeyboardSetupDialog::GuiKeyboardSetupDialog(QWidget *parent)
|
||||||
setWindowTitle("Piano Keyboard Settings");
|
setWindowTitle("Piano Keyboard Settings");
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiKeyboardSetupDialog::init(CSong* song, QSettings* settings)
|
void GuiKeyboardSetupDialog::init(CSong* song, CSettings* settings)
|
||||||
{
|
{
|
||||||
m_song = song;
|
m_song = song;
|
||||||
m_settings = settings;
|
m_settings = settings;
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
|
||||||
#include "Song.h"
|
#include "Song.h"
|
||||||
|
#include "Settings.h"
|
||||||
|
|
||||||
|
|
||||||
#include "ui_GuiKeyboardSetupDialog.h"
|
#include "ui_GuiKeyboardSetupDialog.h"
|
||||||
|
@ -43,7 +44,7 @@ class GuiKeyboardSetupDialog : public QDialog, private Ui::GuiKeyboardSetupDialo
|
||||||
public:
|
public:
|
||||||
GuiKeyboardSetupDialog(QWidget *parent = 0);
|
GuiKeyboardSetupDialog(QWidget *parent = 0);
|
||||||
|
|
||||||
void init(CSong* song, QSettings* settings);
|
void init(CSong* song, CSettings* settings);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void accept();
|
void accept();
|
||||||
|
@ -86,7 +87,7 @@ private:
|
||||||
|
|
||||||
void updateInfoText();
|
void updateInfoText();
|
||||||
|
|
||||||
QSettings* m_settings;
|
CSettings* m_settings;
|
||||||
CSong* m_song;
|
CSong* m_song;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ GuiMidiSetupDialog::GuiMidiSetupDialog(QWidget *parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GuiMidiSetupDialog::init(CSong* song, QSettings* settings)
|
void GuiMidiSetupDialog::init(CSong* song, CSettings* settings)
|
||||||
{
|
{
|
||||||
m_song = song;
|
m_song = song;
|
||||||
m_settings = settings;
|
m_settings = settings;
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
|
||||||
#include "Song.h"
|
#include "Song.h"
|
||||||
|
#include "Settings.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "ui_GuiMidiSetupDialog.h"
|
#include "ui_GuiMidiSetupDialog.h"
|
||||||
|
@ -43,7 +45,7 @@ class GuiMidiSetupDialog : public QDialog, private Ui::GuiMidiSettingsDialog
|
||||||
public:
|
public:
|
||||||
GuiMidiSetupDialog(QWidget *parent = 0);
|
GuiMidiSetupDialog(QWidget *parent = 0);
|
||||||
|
|
||||||
void init(CSong* song, QSettings* settings);
|
void init(CSong* song, CSettings* settings);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void accept();
|
void accept();
|
||||||
|
@ -55,7 +57,7 @@ private slots:
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void updateMidiInfoText();
|
void updateMidiInfoText();
|
||||||
QSettings* m_settings;
|
CSettings* m_settings;
|
||||||
CSong* m_song;
|
CSong* m_song;
|
||||||
int m_latencyFix;
|
int m_latencyFix;
|
||||||
bool m_latencyChanged;
|
bool m_latencyChanged;
|
||||||
|
|
|
@ -40,7 +40,7 @@ GuiPreferencesDialog::GuiPreferencesDialog(QWidget *parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GuiPreferencesDialog::init(CSong* song, QSettings* settings, CGLView * glView)
|
void GuiPreferencesDialog::init(CSong* song, CSettings* settings, CGLView * glView)
|
||||||
{
|
{
|
||||||
m_song = song;
|
m_song = song;
|
||||||
m_settings = settings;
|
m_settings = settings;
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
|
||||||
#include "Song.h"
|
#include "Song.h"
|
||||||
|
#include "Settings.h"
|
||||||
|
|
||||||
|
|
||||||
#include "ui_GuiPreferencesDialog.h"
|
#include "ui_GuiPreferencesDialog.h"
|
||||||
|
@ -45,13 +46,13 @@ class GuiPreferencesDialog : public QDialog, private Ui::GuiPreferencesDialog
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GuiPreferencesDialog(QWidget *parent = 0);
|
GuiPreferencesDialog(QWidget *parent = 0);
|
||||||
void init(CSong* song, QSettings* settings, CGLView* glView);
|
void init(CSong* song, CSettings* settings, CGLView* glView);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void accept();
|
void accept();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSettings* m_settings;
|
CSettings* m_settings;
|
||||||
CSong* m_song;
|
CSong* m_song;
|
||||||
CGLView *m_glView;
|
CGLView *m_glView;
|
||||||
};
|
};
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include "GuiTopBar.h"
|
#include "GuiTopBar.h"
|
||||||
#include "TrackList.h"
|
#include "TrackList.h"
|
||||||
|
|
||||||
GuiSidePanel::GuiSidePanel(QWidget *parent, QSettings* settings)
|
GuiSidePanel::GuiSidePanel(QWidget *parent, CSettings* settings)
|
||||||
: QWidget(parent), m_parent(parent)
|
: QWidget(parent), m_parent(parent)
|
||||||
{
|
{
|
||||||
m_song = 0;
|
m_song = 0;
|
||||||
|
@ -97,8 +97,6 @@ void GuiSidePanel::loadBookList()
|
||||||
|
|
||||||
void GuiSidePanel::openSongFile(QString filename)
|
void GuiSidePanel::openSongFile(QString filename)
|
||||||
{
|
{
|
||||||
QDir dirBooks(filename);
|
|
||||||
|
|
||||||
if (!QFile::exists(filename))
|
if (!QFile::exists(filename))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -109,6 +107,7 @@ void GuiSidePanel::openSongFile(QString filename)
|
||||||
loadSong(filename);
|
loadSong(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Fix me */
|
||||||
void GuiSidePanel::loadSong(QString filename)
|
void GuiSidePanel::loadSong(QString filename)
|
||||||
{
|
{
|
||||||
m_song->loadSong(filename);
|
m_song->loadSong(filename);
|
||||||
|
@ -137,6 +136,7 @@ void GuiSidePanel::on_bookCombo_activated (int index)
|
||||||
for (int i = 0; i < songNames.size(); ++i)
|
for (int i = 0; i < songNames.size(); ++i)
|
||||||
{
|
{
|
||||||
if ( songNames.at(i).endsWith(".mid", Qt::CaseInsensitive ) ||
|
if ( songNames.at(i).endsWith(".mid", Qt::CaseInsensitive ) ||
|
||||||
|
songNames.at(i).endsWith(".midi", Qt::CaseInsensitive ) ||
|
||||||
songNames.at(i).endsWith(".kar", Qt::CaseInsensitive ) )
|
songNames.at(i).endsWith(".kar", Qt::CaseInsensitive ) )
|
||||||
{
|
{
|
||||||
songCombo->addItem( songNames.at(i));
|
songCombo->addItem( songNames.at(i));
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
#include "Song.h"
|
#include "Song.h"
|
||||||
#include "Score.h"
|
#include "Score.h"
|
||||||
#include "TrackList.h"
|
#include "TrackList.h"
|
||||||
|
#include "Settings.h"
|
||||||
|
|
||||||
|
|
||||||
#include "ui_GuiSidePanel.h"
|
#include "ui_GuiSidePanel.h"
|
||||||
|
|
||||||
|
@ -44,7 +46,7 @@ class GuiSidePanel : public QWidget, private Ui::GuiSidePanel
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GuiSidePanel(QWidget *parent, QSettings* settings);
|
GuiSidePanel(QWidget *parent, CSettings* settings);
|
||||||
|
|
||||||
void init(CSong* songObj, CTrackList* trackList, GuiTopBar* topBar);
|
void init(CSong* songObj, CTrackList* trackList, GuiTopBar* topBar);
|
||||||
void openSongFile(QString filename);
|
void openSongFile(QString filename);
|
||||||
|
@ -53,6 +55,16 @@ public:
|
||||||
return m_bookPath + bookCombo->currentText() + '/' + songCombo->currentText();
|
return m_bookPath + bookCombo->currentText() + '/' + songCombo->currentText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void refresh()
|
||||||
|
{
|
||||||
|
if (m_trackList)
|
||||||
|
{
|
||||||
|
m_trackList->refresh();
|
||||||
|
}
|
||||||
|
autoSetMuteYourPart();
|
||||||
|
}
|
||||||
|
void loadBookList();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_songCombo_activated (int index);
|
void on_songCombo_activated (int index);
|
||||||
void on_bookCombo_activated (int index);
|
void on_bookCombo_activated (int index);
|
||||||
|
@ -98,7 +110,6 @@ private slots:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void loadBookList();
|
|
||||||
void loadSong(QString filename);
|
void loadSong(QString filename);
|
||||||
void autoSetMuteYourPart();
|
void autoSetMuteYourPart();
|
||||||
bool eventFilter(QObject *obj, QEvent *event);
|
bool eventFilter(QObject *obj, QEvent *event);
|
||||||
|
@ -109,7 +120,7 @@ private:
|
||||||
QString m_bookPath;
|
QString m_bookPath;
|
||||||
CTrackList* m_trackList;
|
CTrackList* m_trackList;
|
||||||
GuiTopBar* m_topBar;
|
GuiTopBar* m_topBar;
|
||||||
QSettings* m_settings;
|
CSettings* m_settings;
|
||||||
QWidget *m_parent;
|
QWidget *m_parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,9 @@ public:
|
||||||
|
|
||||||
void setPlayButtonState(bool checked, bool atTheEnd = false);
|
void setPlayButtonState(bool checked, bool atTheEnd = false);
|
||||||
|
|
||||||
|
void setSpeed(int value){ speedSpin->setValue(value); }
|
||||||
|
int getSpeed(){return speedSpin->value();}
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_playButton_clicked(bool clicked);
|
void on_playButton_clicked(bool clicked);
|
||||||
void on_playFromStartButton_clicked(bool clicked);
|
void on_playFromStartButton_clicked(bool clicked);
|
||||||
|
|
|
@ -45,7 +45,7 @@ Window::Window()
|
||||||
QCoreApplication::setOrganizationName("PianoBooster");
|
QCoreApplication::setOrganizationName("PianoBooster");
|
||||||
QCoreApplication::setOrganizationDomain("pianobooster.sourceforge.net/");
|
QCoreApplication::setOrganizationDomain("pianobooster.sourceforge.net/");
|
||||||
QCoreApplication::setApplicationName("Piano Booster");
|
QCoreApplication::setApplicationName("Piano Booster");
|
||||||
m_settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, "PianoBooster", "Piano Booster");
|
m_settings = new CSettings(this);
|
||||||
setWindowIcon(QIcon(":/images/Logo32x32.png"));
|
setWindowIcon(QIcon(":/images/Logo32x32.png"));
|
||||||
setWindowTitle(tr("Piano Booster"));
|
setWindowTitle(tr("Piano Booster"));
|
||||||
|
|
||||||
|
@ -61,6 +61,8 @@ Window::Window()
|
||||||
m_sidePanel = new GuiSidePanel(this, m_settings);
|
m_sidePanel = new GuiSidePanel(this, m_settings);
|
||||||
m_topBar = new GuiTopBar(this);
|
m_topBar = new GuiTopBar(this);
|
||||||
|
|
||||||
|
m_settings->init(m_song, m_sidePanel, m_topBar);
|
||||||
|
|
||||||
mainLayout->addWidget(m_sidePanel);
|
mainLayout->addWidget(m_sidePanel);
|
||||||
columnLayout->addWidget(m_topBar);
|
columnLayout->addWidget(m_topBar);
|
||||||
columnLayout->addWidget(m_glWidget);
|
columnLayout->addWidget(m_glWidget);
|
||||||
|
@ -291,7 +293,7 @@ void Window::open()
|
||||||
QString currentSong = m_settings->value("CurrentSong").toString();
|
QString currentSong = m_settings->value("CurrentSong").toString();
|
||||||
|
|
||||||
QString fileName = QFileDialog::getOpenFileName(this,tr("Open Midi File"),
|
QString fileName = QFileDialog::getOpenFileName(this,tr("Open Midi File"),
|
||||||
currentSong, tr("Midi Files (*.mid *.kar)"));
|
currentSong, tr("Midi Files (*.mid *.midi *.kar)"));
|
||||||
if (!fileName.isEmpty())
|
if (!fileName.isEmpty())
|
||||||
m_sidePanel->openSongFile(fileName);
|
m_sidePanel->openSongFile(fileName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
@file QtWindow.cpp
|
@file QtWindow.h
|
||||||
|
|
||||||
@brief xxx.
|
@brief xxx.
|
||||||
|
|
||||||
|
@ -37,6 +37,8 @@
|
||||||
#include "GuiTopBar.h"
|
#include "GuiTopBar.h"
|
||||||
#include "GuiPreferencesDialog.h"
|
#include "GuiPreferencesDialog.h"
|
||||||
#include "GuiLoopingPopup.h"
|
#include "GuiLoopingPopup.h"
|
||||||
|
#include "Settings.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CGLView;
|
class CGLView;
|
||||||
|
@ -131,7 +133,7 @@ private:
|
||||||
void readSettings();
|
void readSettings();
|
||||||
void writeSettings();
|
void writeSettings();
|
||||||
|
|
||||||
QSettings* m_settings;
|
CSettings* m_settings;
|
||||||
|
|
||||||
GuiSidePanel *m_sidePanel;
|
GuiSidePanel *m_sidePanel;
|
||||||
GuiTopBar *m_topBar;
|
GuiTopBar *m_topBar;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user