tagged 0.6.1 (test version for the mac)
git-svn-id: https://svn.code.sf.net/p/pianobooster/code/trunk@41 ba081f5d-443b-49a7-ac4b-446c3f91f371
This commit is contained in:
parent
3b40db9267
commit
d0f26721e5
|
@ -77,6 +77,7 @@ SET( PIANOBOOSTER_SRCS
|
|||
GuiMidiSetupDialog.cpp
|
||||
GuiKeyboardSetupDialog.cpp
|
||||
GuiPreferencesDialog.cpp
|
||||
GuiLoopingDialog.cpp
|
||||
GlView.cpp
|
||||
${PB_BASE_SRCS}
|
||||
StavePosition.cpp
|
||||
|
@ -102,6 +103,7 @@ SET( PIANOBOOSTER_MOC_HDRS
|
|||
GuiMidiSetupDialog.h
|
||||
GuiKeyboardSetupDialog.h
|
||||
GuiPreferencesDialog.h
|
||||
GuiLoopingDialog.h
|
||||
)
|
||||
|
||||
# some .ui files
|
||||
|
@ -111,6 +113,7 @@ SET( PIANOBOOSTER_UIS
|
|||
./GuiMidiSetupDialog.ui
|
||||
./GuiKeyboardSetupDialog.ui
|
||||
./GuiPreferencesDialog.ui
|
||||
./GuiLoopingDialog.ui
|
||||
)
|
||||
|
||||
# and finally an resource file
|
||||
|
|
|
@ -339,10 +339,16 @@ void CConductor::testWrongNoteSound(bool enable)
|
|||
CMidiEvent event;
|
||||
|
||||
|
||||
event.programChangeEvent(0,m_pianistGoodChan, m_cfg_rightNoteSound);
|
||||
playMidiEvent( event );
|
||||
event.programChangeEvent(0,m_pianistBadChan, m_cfg_wrongNoteSound);
|
||||
playMidiEvent( event );
|
||||
if (m_cfg_rightNoteSound>=0) // ignore if set to -1 ("None")
|
||||
{
|
||||
event.programChangeEvent(0, m_pianistGoodChan, m_cfg_rightNoteSound);
|
||||
playMidiEvent( event );
|
||||
}
|
||||
if (m_cfg_wrongNoteSound>=0)
|
||||
{
|
||||
event.programChangeEvent(0, m_pianistBadChan, m_cfg_wrongNoteSound);
|
||||
playMidiEvent( event );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -586,13 +592,19 @@ void CConductor::pianistInput(CMidiEvent inputNote)
|
|||
outputSavedNotesOff();
|
||||
}
|
||||
|
||||
if (goodSound == true)
|
||||
|
||||
if (goodSound == true || m_cfg_wrongNoteSound < 0)
|
||||
{
|
||||
inputNote.setChannel(m_pianistGoodChan);
|
||||
if (m_cfg_rightNoteSound >= 0) // don't play anything if the sound is set to -1 (none)
|
||||
{
|
||||
inputNote.setChannel(m_pianistGoodChan);
|
||||
playMidiEvent( inputNote );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
inputNote.setChannel(m_pianistBadChan);
|
||||
playMidiEvent( inputNote );
|
||||
}
|
||||
|
||||
|
||||
|
@ -610,8 +622,6 @@ void CConductor::pianistInput(CMidiEvent inputNote)
|
|||
}
|
||||
*/
|
||||
|
||||
if (goodSound == false || getLatencyFix() == 0)
|
||||
playMidiEvent( inputNote );
|
||||
}
|
||||
|
||||
// Counts the number of notes the pianist has down
|
||||
|
|
|
@ -111,7 +111,7 @@ void CGLView::drawTimeSignature()
|
|||
if (Cfg::quickStart)
|
||||
return;
|
||||
|
||||
float x,y;
|
||||
int x,y;
|
||||
int topNumber, bottomNumber;
|
||||
|
||||
if (m_song == 0) return;
|
||||
|
@ -193,7 +193,7 @@ void CGLView::drawDisplayText()
|
|||
return;
|
||||
|
||||
glColor3f(1.0,1.0,1.0);
|
||||
float y = Cfg::getAppHeight() - 14;
|
||||
int y = Cfg::getAppHeight() - 14;
|
||||
|
||||
if (m_song->getPlayMode() != PB_PLAY_MODE_listen)
|
||||
renderText(30, y-4,0 ,"Accuracy:", m_timeRatingFont);
|
||||
|
@ -224,7 +224,7 @@ void CGLView::drawBarNumber()
|
|||
//CDraw::drColour (Cfg::backgroundColour());
|
||||
//CDraw::drColour (Cfg::noteColourDim());
|
||||
//glRectf(x+30+10, y-2, x + 80, y + 16);
|
||||
|
||||
//ppTrace("Draw bar number"); //fixme
|
||||
glColor3f(1.0,1.0,1.0);
|
||||
renderText(x, y, 0,"Bar: " + QString::number(m_song->getBarNumber()), m_timeRatingFont);
|
||||
}
|
||||
|
@ -315,7 +315,10 @@ void CGLView::init()
|
|||
m_song->setActiveHand(PB_PART_both);
|
||||
|
||||
if (!Cfg::quickStart)
|
||||
{
|
||||
renderText(10,10,"~", m_timeRatingFont); //fixme this is a work arround for a QT bug.
|
||||
renderText(10,10,"~", m_timeSigFont); //fixme this is a work arround for a QT bug.
|
||||
}
|
||||
|
||||
setFocusPolicy(Qt::ClickFocus);
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ void GuiKeyboardSetupDialog::init(CSong* song, QSettings* settings)
|
|||
|
||||
// Check inputs.
|
||||
QString programName;
|
||||
int i = 0;
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
while (true)
|
||||
|
@ -62,9 +62,9 @@ void GuiKeyboardSetupDialog::init(CSong* song, QSettings* settings)
|
|||
}
|
||||
|
||||
int program = m_settings->value("Keyboard/RightSound", Cfg::defualtRightPatch()).toInt();
|
||||
rightSoundCombo->setCurrentIndex(program - 1);
|
||||
rightSoundCombo->setCurrentIndex(program);
|
||||
program = m_settings->value("Keyboard/WrongSound", Cfg::defualtWrongPatch()).toInt();
|
||||
wrongSoundCombo->setCurrentIndex(program - 1);
|
||||
wrongSoundCombo->setCurrentIndex(program);
|
||||
int lowestNote = m_settings->value("Keyboard/lowestNote", "0").toInt();
|
||||
int highestNote = m_settings->value("Keyboard/highestNote", "127").toInt();
|
||||
|
||||
|
@ -137,8 +137,8 @@ void GuiKeyboardSetupDialog::keyReleaseEvent ( QKeyEvent * event )
|
|||
|
||||
void GuiKeyboardSetupDialog::accept()
|
||||
{
|
||||
m_settings->setValue("Keyboard/RightSound", rightSoundCombo->currentIndex()+1);
|
||||
m_settings->setValue("Keyboard/WrongSound", wrongSoundCombo->currentIndex()+1);
|
||||
m_settings->setValue("Keyboard/RightSound", rightSoundCombo->currentIndex());
|
||||
m_settings->setValue("Keyboard/WrongSound", wrongSoundCombo->currentIndex());
|
||||
int lowestNote = lowestNoteEdit->text().toInt();
|
||||
int highestNote = highestNoteEdit->text().toInt();
|
||||
lowestNote = qBound(0, lowestNote, 127);
|
||||
|
|
|
@ -80,8 +80,8 @@ private:
|
|||
void keyReleaseEvent ( QKeyEvent * event );
|
||||
|
||||
void updateSounds (){
|
||||
m_song->setPianoSoundPatches(rightSoundCombo->currentIndex(),
|
||||
wrongSoundCombo->currentIndex());
|
||||
m_song->setPianoSoundPatches(rightSoundCombo->currentIndex() -1,
|
||||
wrongSoundCombo->currentIndex() -1);
|
||||
}
|
||||
|
||||
void updateInfoText();
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
/*!
|
||||
@file GuiLoopingDialog.cpp
|
||||
|
||||
@brief xxx.
|
||||
|
||||
@author L. J. Barman
|
||||
|
||||
Copyright (c) 2008, L. J. Barman, all rights reserved
|
||||
|
||||
This file is part of the PianoBooster application
|
||||
|
||||
PianoBooster is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
PianoBooster is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with PianoBooster. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
#include "GuiLoopingDialog.h"
|
||||
#include "GlView.h"
|
||||
|
||||
GuiLoopingDialog::GuiLoopingDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
{
|
||||
setupUi(this);
|
||||
m_song = 0;
|
||||
m_settings = 0;
|
||||
m_glView = 0;
|
||||
setWindowTitle("Continious Looping");
|
||||
setModal(false);
|
||||
}
|
||||
|
||||
|
||||
void GuiLoopingDialog::init(CSong* song, QSettings* settings, CGLView * glView)
|
||||
{
|
||||
m_song = song;
|
||||
m_settings = settings;
|
||||
m_glView = glView;
|
||||
}
|
||||
|
||||
void GuiLoopingDialog::accept()
|
||||
{
|
||||
|
||||
|
||||
|
||||
this->QDialog::accept();
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
/*********************************************************************************/
|
||||
/*!
|
||||
@file GuiLoopingDialog.h
|
||||
|
||||
@brief xxxx.
|
||||
|
||||
@author L. J. Barman
|
||||
|
||||
Copyright (c) 2008, L. J. Barman, all rights reserved
|
||||
|
||||
This file is part of the PianoBooster application
|
||||
|
||||
PianoBooster is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
PianoBooster is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with PianoBooster. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
/*********************************************************************************/
|
||||
|
||||
#ifndef __GUILOOPINGDIALOG_H__
|
||||
#define __GUILOOPINGDIALOG_H__
|
||||
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
#include "Song.h"
|
||||
|
||||
|
||||
#include "ui_GuiLoopingDialog.h"
|
||||
|
||||
class CGLView;
|
||||
|
||||
class GuiLoopingDialog : public QDialog, private Ui::GuiLoopingDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GuiLoopingDialog(QWidget *parent = 0);
|
||||
void init(CSong* song, QSettings* settings, CGLView* glView);
|
||||
|
||||
private slots:
|
||||
void accept();
|
||||
|
||||
private:
|
||||
QSettings* m_settings;
|
||||
CSong* m_song;
|
||||
CGLView *m_glView;
|
||||
};
|
||||
|
||||
#endif //__GUILOOPINGDIALOG_H__
|
|
@ -0,0 +1,142 @@
|
|||
<ui version="4.0" >
|
||||
<class>GuiLoopingDialog</class>
|
||||
<widget class="QDialog" name="GuiLoopingDialog" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>276</width>
|
||||
<height>262</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" >
|
||||
<property name="sizeConstraint" >
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title" >
|
||||
<string>Loop between these Bars</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" >
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox" >
|
||||
<property name="text" >
|
||||
<string>Enable Continious Looping</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout" >
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLabel" name="label" >
|
||||
<property name="text" >
|
||||
<string>Play from Bar</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" >
|
||||
<widget class="QLabel" name="label_2" >
|
||||
<property name="text" >
|
||||
<string>End bar</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" >
|
||||
<widget class="QLabel" name="label_3" >
|
||||
<property name="text" >
|
||||
<string>Total Bars to Play</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" >
|
||||
<widget class="QLineEdit" name="lineEdit" >
|
||||
<property name="readOnly" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" >
|
||||
<widget class="QLabel" name="label_4" >
|
||||
<property name="text" >
|
||||
<string>Lead-in Bars</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox" />
|
||||
</item>
|
||||
<item row="3" column="1" >
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_2" />
|
||||
</item>
|
||||
<item row="6" column="1" >
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_3" />
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox" >
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons" >
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>GuiLoopingDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>GuiLoopingDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
|
@ -208,6 +208,12 @@ void Window::createActions()
|
|||
connect(m_setupPreferencesAct, SIGNAL(triggered()), this, SLOT(showPreferencesDialog()));
|
||||
|
||||
|
||||
m_LoopingSongAct = new QAction(QIcon(":/images/open.png"), tr("&Looping ..."), this);
|
||||
m_LoopingSongAct->setShortcut(tr("Ctrl+L"));
|
||||
//m_setupPreferencesAct->setStatusTip(tr("Setup the Midi input an output"));
|
||||
connect(m_LoopingSongAct, SIGNAL(triggered()), this, SLOT(showLoopingDialog()));
|
||||
|
||||
|
||||
QAction* enableFollowTempoAct = new QAction(this);
|
||||
enableFollowTempoAct->setShortcut(tr("Shift+F1"));
|
||||
connect(enableFollowTempoAct, SIGNAL(triggered()), this, SLOT(enableFollowTempo()));
|
||||
|
@ -229,7 +235,10 @@ void Window::createMenus()
|
|||
m_viewMenu = menuBar()->addMenu(tr("&View"));
|
||||
m_viewMenu->addAction(m_toggleSidePanelAct);
|
||||
|
||||
m_setupMenu = menuBar()->addMenu(tr("&Setup"));
|
||||
//m_songMenu = menuBar()->addMenu(tr("&Song"));
|
||||
//m_songMenu->addAction(m_LoopingSongAct);
|
||||
|
||||
m_setupMenu = menuBar()->addMenu(tr("Set&up"));
|
||||
m_setupMenu->addAction(m_setupMidiAct);
|
||||
m_setupMenu->addAction(m_setupKeyboardAct);
|
||||
m_setupMenu->addAction(m_setupPreferencesAct);
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "GuiSidePanel.h"
|
||||
#include "GuiTopBar.h"
|
||||
#include "GuiPreferencesDialog.h"
|
||||
#include "GuiLoopingDialog.h"
|
||||
|
||||
|
||||
class CGLView;
|
||||
|
@ -94,6 +95,13 @@ private slots:
|
|||
preferencesDialog->exec();
|
||||
}
|
||||
|
||||
void showLoopingDialog()
|
||||
{
|
||||
GuiLoopingDialog *loopingDialog = new GuiLoopingDialog(this);
|
||||
loopingDialog->init(m_song, m_settings, m_glWidget);
|
||||
loopingDialog->show();
|
||||
}
|
||||
|
||||
void showKeyboardSetup()
|
||||
{
|
||||
GuiKeyboardSetupDialog *keyboardSetup = new GuiKeyboardSetupDialog(this);
|
||||
|
@ -146,9 +154,11 @@ private:
|
|||
QAction *m_setupKeyboardAct;
|
||||
QAction *m_toggleSidePanelAct;
|
||||
QAction *m_setupPreferencesAct;
|
||||
QAction *m_LoopingSongAct;
|
||||
|
||||
QMenu *m_fileMenu;
|
||||
QMenu *m_viewMenu;
|
||||
QMenu *m_songMenu;
|
||||
QMenu *m_setupMenu;
|
||||
QMenu *m_helpMenu;
|
||||
QToolBar *m_songToolBar;
|
||||
|
|
|
@ -23,8 +23,11 @@ v0.6.1: (11 March 2009)
|
|||
- Fix the pulse of sound when stopping the music
|
||||
- Added timing markers which show when the pianist pressed the note.
|
||||
|
||||
v0.6.2: (11 March 2009)
|
||||
- added "<None>" as intrument sound.
|
||||
- when setting a latency fix of >0 the instrument is automatical set to <None>
|
||||
|
||||
*/
|
||||
|
||||
#define PB_VERSION "0.6.1"
|
||||
#define PB_VERSION "0.6.2 svn"
|
||||
|
||||
|
|
|
@ -247,7 +247,7 @@ QString CTrackList::getChannelProgramName(int chan)
|
|||
|
||||
if (chan==10-1)
|
||||
return "Drums";
|
||||
QString name = getProgramName(program);
|
||||
QString name = getProgramName(program +1); // Skip
|
||||
if (name.isEmpty())
|
||||
name = "Unknown";
|
||||
|
||||
|
@ -258,6 +258,7 @@ QString CTrackList::getProgramName(int program)
|
|||
{
|
||||
const char * const gmInstrumentNames[] =
|
||||
{
|
||||
"(None)", // Don't use
|
||||
/* 1. */ "Grand Piano",
|
||||
/* 2. */ "Bright Piano",
|
||||
/* 3. */ "Electric Grand",
|
||||
|
|
|
@ -67,6 +67,8 @@ public:
|
|||
void examineMidiEvent(CMidiEvent event);
|
||||
bool hasPianoPart();
|
||||
int guessKeySignature(int chanA, int chanB);
|
||||
|
||||
// The programme name now starts at 1 with 0 = "(none)"
|
||||
static QString getProgramName(int program);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue