147 lines
2.7 KiB
C++
147 lines
2.7 KiB
C++
#ifndef _MIDISEQ_SMPTEFORMAT_HPP_
|
|
#define _MIDISEQ_SMPTEFORMAT_HPP_
|
|
#ifndef _COMMON_WINDOWS_HPP_
|
|
#include <common/windows.hpp>
|
|
#endif
|
|
#ifndef _COMMON_FILEIO_HPP_
|
|
#include <common/fileio.hpp>
|
|
#endif
|
|
|
|
class SMPTEFormat
|
|
{
|
|
public:
|
|
enum {SMPTEFormatLength=5};
|
|
SMPTEFormat(void);
|
|
SMPTEFormat(const SMPTEFormat &someSMPTEFormat);
|
|
virtual ~SMPTEFormat();
|
|
SMPTEFormat &operator=(const SMPTEFormat &someSMPTEFormat);
|
|
WORD operator==(const SMPTEFormat &someSMPTEFormat)const;
|
|
FileIO &operator<<(FileIO &midiFile);
|
|
BYTE hours(void)const;
|
|
void hours(BYTE hours);
|
|
BYTE minutes(void)const;
|
|
void minutes(BYTE minutes);
|
|
BYTE seconds(void)const;
|
|
void seconds(BYTE seconds);
|
|
BYTE frames(void)const;
|
|
void frames(BYTE frames);
|
|
BYTE hundredthFrames(void)const;
|
|
void hundredthFrames(BYTE hundredthFrames);
|
|
private:
|
|
BYTE mHours;
|
|
BYTE mMinutes;
|
|
BYTE mSeconds;
|
|
BYTE mFrames;
|
|
BYTE mHundredthFrames;
|
|
};
|
|
|
|
inline
|
|
SMPTEFormat::SMPTEFormat(void)
|
|
: mHours(0), mMinutes(0), mSeconds(0), mFrames(0), mHundredthFrames(0)
|
|
{
|
|
}
|
|
|
|
inline
|
|
SMPTEFormat::SMPTEFormat(const SMPTEFormat &someSMPTEFormat)
|
|
{
|
|
*this=someSMPTEFormat;
|
|
}
|
|
|
|
inline
|
|
SMPTEFormat::~SMPTEFormat()
|
|
{
|
|
}
|
|
|
|
inline
|
|
SMPTEFormat &SMPTEFormat::operator=(const SMPTEFormat &someSMPTEFormat)
|
|
{
|
|
hours(someSMPTEFormat.hours());
|
|
minutes(someSMPTEFormat.minutes());
|
|
seconds(someSMPTEFormat.seconds());
|
|
frames(someSMPTEFormat.frames());
|
|
hundredthFrames(someSMPTEFormat.hundredthFrames());
|
|
return *this;
|
|
}
|
|
|
|
inline
|
|
WORD SMPTEFormat::operator==(const SMPTEFormat &someSMPTEFormat)const
|
|
{
|
|
return (hours()==someSMPTEFormat.hours()&&
|
|
minutes()==someSMPTEFormat.minutes()&&
|
|
seconds()==someSMPTEFormat.seconds()&&
|
|
frames()==someSMPTEFormat.frames()&&
|
|
hundredthFrames()==someSMPTEFormat.hundredthFrames());
|
|
}
|
|
|
|
inline
|
|
BYTE SMPTEFormat::hours(void)const
|
|
{
|
|
return mHours;
|
|
}
|
|
|
|
inline
|
|
void SMPTEFormat::hours(BYTE hours)
|
|
{
|
|
mHours=hours;
|
|
}
|
|
|
|
inline
|
|
BYTE SMPTEFormat::minutes(void)const
|
|
{
|
|
return mMinutes;
|
|
}
|
|
|
|
inline
|
|
void SMPTEFormat::minutes(BYTE minutes)
|
|
{
|
|
mMinutes=minutes;
|
|
}
|
|
|
|
inline
|
|
BYTE SMPTEFormat::seconds(void)const
|
|
{
|
|
return mSeconds;
|
|
}
|
|
|
|
inline
|
|
void SMPTEFormat::seconds(BYTE seconds)
|
|
{
|
|
mSeconds=seconds;
|
|
}
|
|
|
|
inline
|
|
BYTE SMPTEFormat::frames(void)const
|
|
{
|
|
return mFrames;
|
|
}
|
|
|
|
inline
|
|
void SMPTEFormat::frames(BYTE frames)
|
|
{
|
|
mFrames=frames;
|
|
}
|
|
|
|
inline
|
|
BYTE SMPTEFormat::hundredthFrames(void)const
|
|
{
|
|
return mHundredthFrames;
|
|
}
|
|
|
|
inline
|
|
void SMPTEFormat::hundredthFrames(BYTE hundredthFrames)
|
|
{
|
|
mHundredthFrames=hundredthFrames;
|
|
}
|
|
|
|
inline
|
|
FileIO &SMPTEFormat::operator<<(FileIO &midiFile)
|
|
{
|
|
midiFile.read(mHours);
|
|
midiFile.read(mMinutes);
|
|
midiFile.read(mSeconds);
|
|
midiFile.read(mFrames);
|
|
midiFile.read(mHundredthFrames);
|
|
return midiFile;
|
|
}
|
|
#endif
|