Offload most Midi processing from Song into MidiTime class

This commit is contained in:
Colin Wallace
2015-06-22 00:41:33 +00:00
parent 8edfdc0543
commit 18e1d69cac
4 changed files with 103 additions and 8 deletions

View File

@@ -82,6 +82,7 @@ set(LMMS_SRCS
core/midi/MidiController.cpp
core/midi/MidiOss.cpp
core/midi/MidiPort.cpp
core/midi/MidiTime.cpp
core/midi/MidiWinMM.cpp
PARENT_SCOPE

View File

@@ -0,0 +1,49 @@
/*
* MidiTime.cpp - Class that encapsulates the position of a note/event in terms of
* its bar, beat and tick.
*
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net
*
* This file is part of LMMS - http://lmms.io
*
* This program 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 2 of the License, or (at your option) any later version.
*
* This program 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 this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#include "MidiTime.h"
#include "MeterModel.h"
TimeSig::TimeSig( int num, int denom ) :
m_num(num),
m_denom(denom)
{
}
TimeSig::TimeSig( const MeterModel &model ) :
m_num(model.getNumerator()),
m_denom(model.getDenominator())
{
}
int TimeSig::numerator() const
{
return m_num;
}
int TimeSig::denominator() const
{
return m_denom;
}