Files
Work/guitar/backup/20040302/registry.hpp
2024-08-07 09:16:27 -04:00

68 lines
1.8 KiB
C++

#ifndef _GUITAR_REGISTRY_HPP_
#define _GUITAR_REGISTRY_HPP_
#ifndef _COMMON_REGKEY_HPP_
#include <common/regkey.hpp>
#endif
#ifndef _COMMON_BLOCK_HPP_
#include <common/block.hpp>
#endif
#ifndef _COMMON_STRING_HPP_
#include <common/string.hpp>
#endif
#ifndef _GUITAR_INSTRUMENT_HPP_
#include <guitar/Instrument.hpp>
#endif
#ifndef _GUITAR_GUITAR_HPP_
#include <guitar/guitar.hpp>
#endif
class Registry
{
public:
Registry(void);
Registry(const Registry &registry);
virtual ~Registry();
Registry &operator=(const Registry &registry);
bool getHistory(Block<String> &nameList);
bool setHistory(Block<String> &nameList);
bool insertHistory(const String &strName);
bool removeHistory(const String &strName);
bool getShowNotes(void);
void setShowNotes(bool showNoteLetters);
bool getShowAction(void)const;
void setShowAction(bool showAction);
int getMicrosecondsPerQuarterNote(void)const;
void setMicrosecondsPerQuarterNote(int microsecondsPerQuarterNote);
long getMillisecondsPerQuarterNote(void)const;
Instrument getInstrument(void)const;
void setInstrument(Instrument instrument);
String getMIDIOutputDevice(void)const;
void setMIDIOutputDevice(const String &midiOutputDevice);
bool isOkay(void)const;
private:
enum {MaxCachedNames=7};
void guarantee(void);
void getCacheNames(void);
bool removeHistory(void);
Block<String> mCachedNames;
String mHistoryKeyName;
String mHistoryKeyShortName;
String mRegistryKeyName;
String mSettingsKeyName;
String mSettingsAction;
String mSettingsNoteLetters;
String mSettingsMicrosecondsPerQuarterNote;
String mSettingsInstrument;
String mSettingsMIDIOutput;
RegKey mRegKeyHistory;
RegKey mRegKeySettings;
};
inline
long Registry::getMillisecondsPerQuarterNote(void)const
{
return getMicrosecondsPerQuarterNote()/1000;
}
#endif