This commit is contained in:
2024-08-07 09:16:27 -04:00
parent fdfadd5c7e
commit 5f971cf684
5200 changed files with 731717 additions and 0 deletions

BIN
drums/Debug/RCa00880 Normal file

Binary file not shown.

BIN
drums/Debug/drums.exe Normal file

Binary file not shown.

BIN
drums/Debug/drums.exp Normal file

Binary file not shown.

BIN
drums/Debug/drums.ilk Normal file

Binary file not shown.

BIN
drums/Debug/drums.lib Normal file

Binary file not shown.

BIN
drums/Debug/drums.pdb Normal file

Binary file not shown.

BIN
drums/Debug/drums.res Normal file

Binary file not shown.

BIN
drums/Debug/vc60.idb Normal file

Binary file not shown.

BIN
drums/Debug/vc60.pdb Normal file

Binary file not shown.

126
drums/DrumControl.cpp Normal file
View File

@@ -0,0 +1,126 @@
#include <drums/DrumControl.hpp>
#include <common/control.hpp>
char DrumControl::smszClassName[]={"DRUMCONTROL"};
DrumControl::DrumControl(GUIWindow &parent)
{
mPaintHandler.setCallback(this,&DrumControl::paintHandler);
mCreateHandler.setCallback(this,&DrumControl::createHandler);
mDestroyHandler.setCallback(this,&DrumControl::destroyHandler);
mSizeHandler.setCallback(this,&DrumControl::sizeHandler);
insertHandler(VectorHandler::CreateHandler,&mCreateHandler);
insertHandler(VectorHandler::PaintHandler,&mPaintHandler);
insertHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
insertHandler(VectorHandler::DestroyHandler,&mSizeHandler);
registerClass();
createWindow(parent);
}
DrumControl::~DrumControl()
{
removeHandler(VectorHandler::PaintHandler,&mPaintHandler);
removeHandler(VectorHandler::CreateHandler,&mCreateHandler);
removeHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
insertHandler(VectorHandler::DestroyHandler,&mSizeHandler);
}
void DrumControl::registerClass()
{
HINSTANCE hInstance(processInstance());
WNDCLASS wndClass;
if(::GetClassInfo(hInstance,smszClassName,(WNDCLASS FAR*)&wndClass))return;
wndClass.style =CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS|CS_OWNDC;
wndClass.lpfnWndProc =(WNDPROC)GUIWindow::WndProc;
wndClass.cbClsExtra =0;
wndClass.cbWndExtra =sizeof(DrumControl*);
wndClass.hInstance =hInstance;
wndClass.hIcon =::LoadIcon(NULL,IDI_APPLICATION);
wndClass.hCursor =::LoadCursor(NULL,IDC_ARROW);
// wndClass.hbrBackground =(HBRUSH)::GetStockObject(BLACK_BRUSH);
wndClass.hbrBackground =(HBRUSH)::GetStockObject(NULL_BRUSH);
wndClass.lpszMenuName =0;
wndClass.lpszClassName =smszClassName;
::RegisterClass(&wndClass);
}
void DrumControl::createWindow(GUIWindow &parent)
{
Rect winRect;
mResBitmap=new ResBitmap("Magenta");
mResBitmap.disposition(PointerDisposition::Delete);
mPureDevice=new PureDevice(*this);
mPureDevice.disposition(PointerDisposition::Delete);
mDIBitmap=new DIBitmap(*mPureDevice,mResBitmap->width(),mResBitmap->height(),*mResBitmap);
mDIBitmap.disposition(PointerDisposition::Delete);
parent.clientRect(winRect);
winRect.bottom(winRect.bottom()*.75);
Window::createWindow(WS_EX_CLIENTEDGE,smszClassName,smszClassName,
WS_CHILD|WS_OVERLAPPED|WS_CLIPCHILDREN|WS_BORDER,winRect,
parent,(HMENU)0,processInstance(),(LPSTR)this);
show(SW_SHOW);
update();
}
CallbackData::ReturnType DrumControl::createHandler(CallbackData &/*someCallbackData*/)
{
mPureDevice=new PureDevice(*this);
mPureDevice.disposition(PointerDisposition::Delete);
mDIBitmap=new DIBitmap(*mPureDevice,mResBitmap->width(),mResBitmap->height(),*mResBitmap);
mDIBitmap.disposition(PointerDisposition::Delete);
createButtons();
return (CallbackData::ReturnType)FALSE;
}
CallbackData::ReturnType DrumControl::destroyHandler(CallbackData &/*someCallbackData*/)
{
return (CallbackData::ReturnType)FALSE;
}
CallbackData::ReturnType DrumControl::sizeHandler(CallbackData &/*someCallbackData*/)
{
return (CallbackData::ReturnType)FALSE;
}
CallbackData::ReturnType DrumControl::paintHandler(CallbackData &someCallbackData)
{
if(!mResBitmap.isOkay())return (CallbackData::ReturnType)FALSE;
PaintInformation *pPaintInfo=(PaintInformation*)someCallbackData.lParam();
PureDevice &pureDevice=(PureDevice&)*pPaintInfo;
mDIBitmap->copyBits(mResBitmap->ptrData(),mResBitmap->imageExtent());
mDIBitmap->stretchBlt(pureDevice,Rect(0,0,width(),height()));
return (CallbackData::ReturnType)FALSE;
}
void DrumControl::createButtons()
{
int rows=8;
int cols=16;
int spacing=2;
int width=10;
int height=10;
int startx=10;
int starty=10;
int xpos;
int ypos;
ypos=starty;
for(int row=0;row<rows;row++)
{
xpos=startx;
for(int col=0;col<cols;col++)
{
int index=(row*cols)+col;
mButtons.insert(&SmartPointer<Control>());
SmartPointer<Control> &control=mButtons[index];
control=new Control();
control.disposition(PointerDisposition::Delete);
control->createControl("BUTTON","",WS_CHILD|WS_CLIPSIBLINGS|WS_VISIBLE,Rect(xpos,ypos,xpos+width,ypos+height),*this,index);
xpos+=(width+spacing);
}
ypos+=(height+spacing);
}
}

42
drums/DrumControl.hpp Normal file
View File

@@ -0,0 +1,42 @@
#ifndef _DRUMS_DRUMCONTROL_HPP_
#define _DRUMS_DRUMCONTROL_HPP_
#ifndef _COMMON_RESBITMAP_HPP_
#include <common/resbmp.hpp>
#endif
#ifndef _COMMON_WINDOW_HPP_
#include <common/window.hpp>
#endif
#ifndef _COMMON_SMARTPOINTER_HPP_
#include <common/pointer.hpp>
#endif
#ifndef _COMMON_DIBITMAP_HPP_
#include <common/dib.hpp>
#endif
class DrumControl : public Window
{
public:
DrumControl(GUIWindow &parent);
virtual ~DrumControl();
protected:
private:
void registerClass(void);
void createWindow(GUIWindow &parent);
void createButtons(void);
CallbackData::ReturnType paintHandler(CallbackData &someCallbackData);
CallbackData::ReturnType createHandler(CallbackData &someCallbackData);
CallbackData::ReturnType destroyHandler(CallbackData &someCallbackData);
CallbackData::ReturnType sizeHandler(CallbackData &someCallbackData);
Callback<DrumControl> mPaintHandler;
Callback<DrumControl> mCreateHandler;
Callback<DrumControl> mDestroyHandler;
Callback<DrumControl> mSizeHandler;
static char smszClassName[];
Block<SmartPointer<Control> > mButtons;
// Block<Control> mButtons;
SmartPointer<ResBitmap> mResBitmap;
SmartPointer<PureDevice> mPureDevice;
SmartPointer<DIBitmap> mDIBitmap;
};
#endif

BIN
drums/MAGENTA.BMP Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

570
drums/ViewWnd.cpp Normal file
View File

@@ -0,0 +1,570 @@
#include <drums/viewwnd.hpp>
#include <drums/drums.hpp>
#include <drums/DrumControl.hpp>
//#include <guitar/guitar.hpp>
//#include <guitar/GlobalDefs.hpp>
//#include <guitar/MessageBox.hpp>
#include <statbar/statbarx.hpp>
#include <common/profile.hpp>
#include <common/puremenu.hpp>
#include <common/opendlg.hpp>
#include <common/mdifrm.hpp>
ViewWindow::ViewWindow(void)
//: mIsInRepeatPlay(false)
{
mCreateHandler.setCallback(this,&ViewWindow::createHandler);
mSizeHandler.setCallback(this,&ViewWindow::sizeHandler);
mPaintHandler.setCallback(this,&ViewWindow::paintHandler);
mLeftButtonDoubleHandler.setCallback(this,&ViewWindow::leftButtonDoubleHandler);
mThreadHandler.setCallback(this,&ViewWindow::threadHandler);
mCloseHandler.setCallback(this,&ViewWindow::closeHandler);
mRightButtonDownHandler.setCallback(this,&ViewWindow::rightButtonDownHandler);
MDIWindow::insertHandler(VectorHandler::CreateHandler,&mCreateHandler);
MDIWindow::insertHandler(VectorHandler::SizeHandler,&mSizeHandler);
MDIWindow::insertHandler(VectorHandler::PaintHandler,&mPaintHandler);
MDIWindow::insertHandler(VectorHandler::LeftButtonDoubleHandler,&mLeftButtonDoubleHandler);
MDIWindow::insertHandler(VectorHandler::CloseHandler,&mCloseHandler);
MDIWindow::insertHandler(VectorHandler::RightButtonDownHandler,&mRightButtonDownHandler);
MessageThread::insertHandler(&mThreadHandler);
start();
}
ViewWindow::~ViewWindow()
{
MDIWindow::removeHandler(VectorHandler::CreateHandler,&mCreateHandler);
MDIWindow::removeHandler(VectorHandler::SizeHandler,&mSizeHandler);
MDIWindow::removeHandler(VectorHandler::PaintHandler,&mPaintHandler);
MDIWindow::removeHandler(VectorHandler::LeftButtonDoubleHandler,&mLeftButtonDoubleHandler);
MDIWindow::removeHandler(VectorHandler::CloseHandler,&mCloseHandler);
MDIWindow::removeHandler(VectorHandler::RightButtonDownHandler,&mRightButtonDownHandler);
stop();
}
CallbackData::ReturnType ViewWindow::createHandler(CallbackData &someCallbackData)
{
/* mTabPage=::new TabPage(*this);
mTabPage.disposition(PointerDisposition::Delete);
setTitle(STRING_NOTITLE);*/
mDrumControl=new DrumControl(*this);
mDrumControl.disposition(PointerDisposition::Delete);
setTitle("{None}");
return false;
}
CallbackData::ReturnType ViewWindow::closeHandler(CallbackData &someCallbackData)
{
/* mTabPage->setCancelled(true);
if(mTabPage->isDirty())
{
LRESULT result=MessageBox::messageBox(*this,"Project has changed.","Save changes?",MB_YESNOCANCEL);
if(IDCANCEL==result)return true;
else if(IDNO==result)
{
mTabPage->isDirty(false);
return false;
}
else
{
saveProject();
mTabPage->isDirty(false);
return false;
}
}
*/
return false;
}
CallbackData::ReturnType ViewWindow::rightButtonDownHandler(CallbackData &someCallbackData)
{
/* GlobalDefs::outDebug("ViewWindow::rightButtonDownHandler");
PureMenu popupMenu(PureMenu::PopupMenu);
GDIPoint trackPoint;
trackPoint.x(someCallbackData.loWord());
trackPoint.y(someCallbackData.hiWord());
clientToScreen(trackPoint);
if(mTabPage->isInPlay())
{
popupMenu.appendMenu(MENU_TABLATURE_STOP,"&Stop");
}
else
{
popupMenu.appendMenu(MENU_TABLATURE_PLAY,"&Play");
popupMenu.appendMenu(MENU_TABLATURE_PLAYREPEATED,"Play (&Repeated)");
if(mTabPage->hasRange())
{
popupMenu.appendMenu(MENU_TABLATURE_PLAYRANGE,"Play R&ange...");
popupMenu.appendMenu(MENU_TABLATURE_PLAYRANGE_REPEATED,"Play Rang&e (Repeated)...");
}
if(mTabPage->isInOutline())
{
popupMenu.appendMenu(MENU_TABLATURE_PLAYTOEND,"P&lay From Here");
if(!mTabPage->isInSetRange())
{
popupMenu.appendSeparator();
popupMenu.appendMenu(MENU_TABLATURE_SETSTARTRANGE,"S&tart Range");
}
else
{
popupMenu.appendSeparator();
popupMenu.appendMenu(MENU_TABLATURE_SETENDRANGE,"&End Range");
}
popupMenu.appendSeparator();
popupMenu.appendMenu(MENU_TABLATURE_ENTRYPROPS,"&Properties...");
}
}
popupMenu.trackPopupMenu(*(getFrame()),trackPoint);
::SetCursorPos(trackPoint.x(),trackPoint.y());
*/
return false;
}
CallbackData::ReturnType ViewWindow::sizeHandler(CallbackData &someCallbackData)
{
return false;
}
CallbackData::ReturnType ViewWindow::paintHandler(CallbackData &someCallbackData)
{
return false;
}
CallbackData::ReturnType ViewWindow::leftButtonDoubleHandler(CallbackData &someCallbackData)
{
return false;
}
// ************************************************************************************************
/*
bool ViewWindow::insert(const TabEntry &entry)
{
// return mTabPage->insert(entry);
return false;
}
*/
/*
bool ViewWindow::insert(const TabEntries &entries)
{
if(!mTabPage->insert(entries))return false;
invalidate();
mTabPage->isDirty(true);
return true;
}
*/
void ViewWindow::setTitle(const String &strTitle)
{
String strCaption;
String strString;
windowText(strCaption);
strString=strCaption;
strCaption=strCaption.betweenString(0,' ');
if(strCaption.isNull())strCaption=strString;
strCaption+=String(" - [")+strTitle+String("]");
setCaption(strCaption);
}
String ViewWindow::getTitle(void)const
{
String strCaption;
windowText(strCaption);
return strCaption.betweenString('[',']');
}
/*
void ViewWindow::play(void)
{
ThreadMessage thMessage(ThreadMessage::TM_USER,THPlay);
enablePlaySelect(false);
MessageThread::postMessage(thMessage);
return;
}
void ViewWindow::playFromCurrent(void)
{
ThreadMessage thMessage(ThreadMessage::TM_USER,THPlayFromCurrent);
enablePlaySelect(false);
MessageThread::postMessage(thMessage);
return;
}
void ViewWindow::playRepeated(void)
{
ThreadMessage thMessage(ThreadMessage::TM_USER,THPlay);
enablePlaySelect(false);
isInRepeatPlay(true);
MessageThread::postMessage(thMessage);
return;
}
void ViewWindow::playRange(int rangeIndex)
{
ThreadMessage thMessage(ThreadMessage::TM_USER,THPlayRange,rangeIndex);
enablePlaySelect(false);
MessageThread::postMessage(thMessage);
}
void ViewWindow::playRangeRepeated(int rangeIndex)
{
ThreadMessage thMessage(ThreadMessage::TM_USER,THPlayRange,rangeIndex);
enablePlaySelect(false);
isInRepeatPlay(true);
MessageThread::postMessage(thMessage);
}
void ViewWindow::stopPlay(void)
{
isInRepeatPlay(false);
mTabPage->setCancelled(true);
}
void ViewWindow::modifyProperties(void)
{
mTabPage->modifyProperties();
}
void ViewWindow::increaseTempo(void)
{
mTabPage->increaseTempo();
}
void ViewWindow::decreaseTempo(void)
{
mTabPage->decreaseTempo();
}
void ViewWindow::enablePlaySelect(bool enable)
{
PureMenu &pureMenu=getMenu();
if(enable)
{
pureMenu.enableMenuItem(MENU_TABLATURE_PLAY,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
pureMenu.enableMenuItem(MENU_TABLATURE_PLAYREPEATED,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
pureMenu.enableMenuItem(MENU_TABLATURE_PLAYRANGE,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
pureMenu.enableMenuItem(MENU_TABLATURE_STOP,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemGrayed|PureMenu::ItemDisabled));
}
else
{
pureMenu.enableMenuItem(MENU_TABLATURE_PLAY,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemGrayed|PureMenu::ItemDisabled));
pureMenu.enableMenuItem(MENU_TABLATURE_PLAYREPEATED,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemGrayed|PureMenu::ItemDisabled));
pureMenu.enableMenuItem(MENU_TABLATURE_PLAYRANGE,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemGrayed|PureMenu::ItemDisabled));
pureMenu.enableMenuItem(MENU_TABLATURE_STOP,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
}
}
void ViewWindow::enableCut(bool enable)
{
PureMenu &pureMenu=getMenu();
pureMenu.enableMenuItem(MENU_EDIT_CUT,PureMenu::ByCommand,enable?PureMenu::InsertFlags(PureMenu::ItemEnabled):PureMenu::InsertFlags(PureMenu::ItemGrayed|PureMenu::ItemDisabled));
}
void ViewWindow::enableCopy(bool enable)
{
PureMenu &pureMenu=getMenu();
pureMenu.enableMenuItem(MENU_EDIT_COPY,PureMenu::ByCommand,enable?PureMenu::InsertFlags(PureMenu::ItemEnabled):PureMenu::InsertFlags(PureMenu::ItemGrayed|PureMenu::ItemDisabled));
}
void ViewWindow::enablePaste(bool enable)
{
PureMenu &pureMenu=getMenu();
pureMenu.enableMenuItem(MENU_EDIT_PASTE,PureMenu::ByCommand,enable?PureMenu::InsertFlags(PureMenu::ItemEnabled):PureMenu::InsertFlags(PureMenu::ItemGrayed|PureMenu::ItemDisabled));
}
bool ViewWindow::getEnableCut(void)
{
UINT state;
PureMenu &pureMenu=getMenu();
state=pureMenu.getMenuState(MENU_EDIT_CUT,PureMenu::ByCommand);
return !((state&MF_GRAYED)||(state&MF_DISABLED));
}
bool ViewWindow::getEnableCopy(void)
{
UINT state;
PureMenu &pureMenu=getMenu();
state=pureMenu.getMenuState(MENU_EDIT_COPY,PureMenu::ByCommand);
return !((state&MF_GRAYED)||(state&MF_DISABLED));
}
bool ViewWindow::getEnablePaste(void)
{
UINT state;
PureMenu &pureMenu=getMenu();
state=pureMenu.getMenuState(MENU_EDIT_PASTE,PureMenu::ByCommand);
return !((state&MF_GRAYED)||(state&MF_DISABLED));
}
void ViewWindow::enableStopSelect(bool enable)
{
PureMenu &pureMenu=getMenu();
if(enable)pureMenu.enableMenuItem(MENU_TABLATURE_STOP,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
else pureMenu.enableMenuItem(MENU_TABLATURE_STOP,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemGrayed|PureMenu::ItemDisabled));
}
bool ViewWindow::createProject(const String &strPathTabFile)
{
if(Profile::verifyPathFileName(Tablature::getPathFileProject(strPathTabFile)))
{
String strMessage=String("Project '")+Tablature::getPathFileProject(strPathTabFile)+String("' already exists, overwrite?");
if(IDCANCEL==MessageBox::messageBox(*this,"Warning",strMessage,MB_OKCANCEL))return false;
}
if(!mTablature.import(strPathTabFile))
{
switch(mTablature.getLastError())
{
case Tablature::FileOpenError :
MessageBox::messageBox(*this,"Load Tablature","Referenced tablature could not be opened.");
return false;
case Tablature::NoTabsParsedError :
MessageBox::messageBox(*this,"Load Tablature","File contained no valid tablatures.",MB_OK);
return false;
case Tablature::NoFrettedNotesError :
MessageBox::messageBox(*this,"Load Tablature","File contained tablatures, but none of them were parsed.");
return false;
default :
MessageBox::messageBox(*this,"Load Tablature","Error creating project.");
return false;
}
}
setTitle(mTablature.getPathFileProject());
saveProject();
show(SW_SHOW);
top();
mTabPage->insert(mTablature.getTabEntries(),false);
PureMenu &pureMenu=getMenu();
pureMenu.enableMenuItem(MENU_TABLATURE_STOP,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemGrayed|PureMenu::ItemDisabled));
invalidate();
return true;
}
bool ViewWindow::createProject(void)
{
show(SW_SHOW);
top();
setTitle(STRING_NOTITLE);
PureMenu &pureMenu=getMenu();
pureMenu.enableMenuItem(MENU_TABLATURE_STOP,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemGrayed|PureMenu::ItemDisabled));
invalidate();
mTabPage->isDirty(true);
return true;
}
bool ViewWindow::openProject(const String &pathFileName)
{
if(!mTablature.openProject(pathFileName))
{
switch(mTablature.getLastError())
{
case Tablature::FileOpenError :
MessageBox::messageBox(*this,pathFileName,"Referenced tablature could not be opened.");
return false;
case Tablature::NoTabsParsedError :
MessageBox::messageBox(*this,pathFileName,"File contained no valid tablatures.");
return false;
case Tablature::NoFrettedNotesError :
MessageBox::messageBox(*this,pathFileName,"Warning, No tablatures were found in the file.\nYou can insert tablature by using the Insert key.");
}
}
PureMenu &pureMenu=getMenu();
show(SW_SHOW);
top();
mTabPage->insert(mTablature.getTabEntries(),false); // don't set the dirty flag when loading
if(mTabPage->insert(mTablature.getTabRanges(),false)) // don't set the dirty flag when loading
{
pureMenu.enableMenuItem(MENU_TABLATURE_PLAYRANGE,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
pureMenu.enableMenuItem(MENU_TABLATURE_PLAYRANGE_REPEATED,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
}
setTitle(mTablature.getPathFileProject());
pureMenu.enableMenuItem(MENU_TABLATURE_STOP,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemGrayed|PureMenu::ItemDisabled));
return true;
}
bool ViewWindow::getProjectName(String &strPathFileProject)
{
OpenDialog openDialog;
if(!openDialog.getSaveFileName(*this,"Project Files","Project Save",String(STRING_PRJALLEXTENSION),strPathFileProject))return false;
if(!strPathFileProject.strstr(String(STRING_PRJEXTENSION)))strPathFileProject+=String(STRING_PRJEXTENSION);
return true;
}
bool ViewWindow::saveProject(const String &pathFileName)
{
bool returnCode=false;
if(mTabPage->isDirty())
{
mTablature.setTabEntries(mTabPage->getEntries());
mTablature.setTabRanges(mTabPage->getRanges());
mTabPage->isDirty(false);
}
returnCode=mTablature.saveProject(pathFileName);
if(returnCode&&String(STRING_NOTITLE)==getTitle())setTitle(mTablature.getPathFileProject());
return returnCode;
}
bool ViewWindow::saveProject(void)
{
bool returnCode=false;
if(getTitle()==String(STRING_NOTITLE))
{
Registry registry;
String strPathFileProject;
if(!getProjectName(strPathFileProject))return false;
if(!saveProject(strPathFileProject))return false;
registry.insertHistory(strPathFileProject);
setTitle(mTablature.getPathFileProject());
return true;
}
if(mTabPage->isDirty())
{
mTablature.setTabEntries(mTabPage->getEntries());
mTablature.setTabRanges(mTabPage->getRanges());
mTabPage->isDirty(false);
}
returnCode=mTablature.saveProject();
if(returnCode&&String(STRING_NOTITLE)==getTitle())setTitle(mTablature.getPathFileProject());
return returnCode;
}
void ViewWindow::cut(void)
{
mTabPage->cut();
}
void ViewWindow::copy(void)
{
mTabPage->copy();
}
void ViewWindow::paste(void)
{
mTabPage->paste();
}
void ViewWindow::setStartRange(void)
{
mTabPage->setStartRange();
}
void ViewWindow::setEndRange(void)
{
PureMenu &pureMenu=getMenu();
mTabPage->setEndRange();
pureMenu.enableMenuItem(MENU_TABLATURE_PLAYRANGE,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
pureMenu.enableMenuItem(MENU_TABLATURE_PLAYRANGE_REPEATED,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
}
bool ViewWindow::getTabRanges(TabRanges &ranges)
{
ranges.remove();
ranges=mTabPage->getRanges();
return ranges.size()?true:false;
}
void ViewWindow::setTabRanges(const TabRanges &ranges)
{
PureMenu &pureMenu=getMenu();
mTabPage->setRanges(ranges);
if(ranges.size())
{
pureMenu.enableMenuItem(MENU_TABLATURE_PLAYRANGE,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
pureMenu.enableMenuItem(MENU_TABLATURE_PLAYRANGE_REPEATED,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
}
else
{
pureMenu.enableMenuItem(MENU_TABLATURE_PLAYRANGE,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemGrayed|PureMenu::ItemDisabled));
pureMenu.enableMenuItem(MENU_TABLATURE_PLAYRANGE_REPEATED,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemGrayed|PureMenu::ItemDisabled));
}
}
*/
// thread handler
DWORD ViewWindow::threadHandler(ThreadMessage &threadMessage)
{
switch(threadMessage.message())
{
case ThreadMessage::TM_USER :
break;
// if(THPlay==threadMessage.userDataOne())thPlay();
// else if(THPlayFromCurrent==threadMessage.userDataOne())thPlayFromCurrent();
// else if(THPlayRange==threadMessage.userDataOne())thPlayRange(threadMessage.userDataTwo());
}
return 0;
}
/*
void ViewWindow::thPlayRange(int rangeIndex)
{
::OutputDebugString("[ViewWindow::thPlayRange] ENTER\n");
ThreadPriority prevPriority=setThreadPriority(PureThread::ThreadPriorityHighest);
mTabPage->playRange(rangeIndex);
setThreadPriority(prevPriority);
if(mTabPage->getCancelled())isInRepeatPlay(false);
if(isInRepeatPlay())
{
::Sleep(RestBeforeRepeat);
ThreadMessage thMessage(ThreadMessage::TM_USER,THPlayRange,rangeIndex);
MessageThread::postMessage(thMessage);
}
else
{
enablePlaySelect(true);
}
::OutputDebugString("[ViewWindow::thPlayRange] LEAVE\n");
}
void ViewWindow::thPlay()
{
::OutputDebugString("[ViewWindow::thPlay] ENTER\n");
ThreadPriority prevPriority=setThreadPriority(PureThread::ThreadPriorityHighest);
mTabPage->play();
setThreadPriority(prevPriority);
if(mTabPage->getCancelled())isInRepeatPlay(false);
if(isInRepeatPlay())
{
::Sleep(RestBeforeRepeat);
ThreadMessage thMessage(ThreadMessage::TM_USER,THPlay);
MessageThread::postMessage(thMessage);
}
else
{
enablePlaySelect(true);
}
::OutputDebugString("[ViewWindow::thPlay] LEAVE\n");
}
void ViewWindow::thPlayFromCurrent()
{
::OutputDebugString("[ViewWindow::thPlayFromCurrent] ENTER\n");
ThreadPriority prevPriority=setThreadPriority(PureThread::ThreadPriorityHighest);
mTabPage->playFromCurrent();
setThreadPriority(prevPriority);
enablePlaySelect(true);
::OutputDebugString("[ViewWindow::thPlayFromCurrent] LEAVE\n");
}
*/
// *** virtuals
void ViewWindow::preRegister(WNDCLASS &wndClass)
{
wndClass.style|=CS_SAVEBITS|CS_OWNDC;
wndClass.hbrBackground=(HBRUSH)::GetStockObject(WHITE_BRUSH);
wndClass.hCursor=::LoadCursor(processInstance(),MAKEINTRESOURCE(HARROW));
}
void ViewWindow::preCreate(MDICREATESTRUCT &createStruct)
{
createStruct.style=WS_SYSMENU|WS_CAPTION|WS_THICKFRAME|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_CLIPCHILDREN|WS_CLIPSIBLINGS;
}

157
drums/ViewWnd.hpp Normal file
View File

@@ -0,0 +1,157 @@
#ifndef _DRUMS_VIEWWINDOW_HPP_
#define _DRUMS_VIEWWINDOW_HPP_
#ifndef _COMMON_MDIWIN_HPP_
#include <common/mdiwin.hpp>
#endif
#ifndef _COMMON_SMARTPOINTER_HPP_
#include <common/pointer.hpp>
#endif
//#ifndef _GUITAR_TABLATURE_HPP_
//#include <guitar/tablature.hpp>
//#endif
#ifndef _THREAD_MESSAGETHREAD_HPP_
#include <thread/mthread.hpp>
#endif
//#ifndef _GUITAR_TABPAGE_HPP_
//#include <guitar/tabpage.hpp>
//#endif
#ifndef _MIDISEQ_MIDIOUTDEVICE_HPP_
#include <midiseq/midiout.hpp>
#endif
class StatusBarEx;
class DrumControl;
class ViewWindow : public MDIWindow, public MessageThread
{
public:
enum{THPlay,THPlayFromCurrent,THPlayRange,THStop};
ViewWindow(void);
virtual ~ViewWindow();
// void setFretboardHandler(CallbackPointer &callbackPointer);
// bool createProject(const String &strPathTabFile);
// bool createProject(void);
// bool openProject(const String &pathFileName);
// bool saveProject(const String &pathFileName);
// bool saveProject(void);
// void play(void);
// void playFromCurrent(void);
// void stopPlay(void);
// void playRepeated(void);
// void playRange(int rangeIndex);
// void playRangeRepeated(int rangeIndex);
// void cut(void);
// void copy(void);
// void paste(void);
// void modifyProperties(void);
// void setStartRange(void);
// void setEndRange(void);
// bool getTabRanges(TabRanges &ranges);
// void setTabRanges(const TabRanges &ranges);
// const TabEntries &getEntries(void)const;
// bool insert(const TabEntry &entry);
// bool insert(const TabEntries &entries);
// int getNumTabEntries(void)const;
// void increaseTempo(void);
// void decreaseTempo(void);
String getTitle(void)const;
// const String &getPathFileProject(void)const;
// void setStatusControlRef(SmartPointer<StatusBarEx> &statusBar);
// bool isDirty(void);
protected:
virtual void preRegister(WNDCLASS &wndClass);
virtual void preCreate(MDICREATESTRUCT &createStruct);
private:
enum {WindowWidth=565,WindowHeight=210,RestBeforeRepeat=500};
CallbackData::ReturnType createHandler(CallbackData &someCallbackData);
CallbackData::ReturnType sizeHandler(CallbackData &someCallbackData);
CallbackData::ReturnType paintHandler(CallbackData &someCallbackData);
CallbackData::ReturnType leftButtonDoubleHandler(CallbackData &someCallbackData);
CallbackData::ReturnType closeHandler(CallbackData &someCallbackData);
CallbackData::ReturnType rightButtonDownHandler(CallbackData &someCallbackData);
DWORD threadHandler(ThreadMessage &threadMessage);
void setTitle(const String &strTitle);
// void enablePlaySelect(bool enable);
// void enableStopSelect(bool enable);
// void enableCut(bool enable);
// void enableCopy(bool enable);
// void enablePaste(bool enable);
// bool getEnableCut(void);
// bool getEnableCopy(void);
// bool getEnablePaste(void);
// bool isInRepeatPlay(void)const;
// void isInRepeatPlay(bool isInRepeatPlay);
// bool getProjectName(String &strPathFileProject);
// void thPlay(void);
// void thPlayFromCurrent(void);
// void thPlayRange(int rangeIndex);
Callback<ViewWindow> mCreateHandler;
Callback<ViewWindow> mSizeHandler;
Callback<ViewWindow> mPaintHandler;
Callback<ViewWindow> mLeftButtonDoubleHandler;
Callback<ViewWindow> mPlayNoteHandler;
Callback<ViewWindow> mCloseHandler;
Callback<ViewWindow> mRightButtonDownHandler;
ThreadCallback<ViewWindow> mThreadHandler;
SmartPointer<DrumControl> mDrumControl;
// SmartPointer<TabPage> mTabPage;
// SmartPointer<MIDIOutputDevice> mMIDIDevice;
// Tablature mTablature;
// bool mIsInRepeatPlay;
};
/*
inline
const TabEntries &ViewWindow::getEntries(void)const
{
return ((SmartPointer<TabPage>&)mTabPage)->getEntries();
}
inline
void ViewWindow::setFretboardHandler(CallbackPointer &callbackPointer)
{
mTabPage->setPlayNoteHandler(callbackPointer);
}
inline
bool ViewWindow::isDirty(void)
{
return mTabPage->isDirty();
}
inline
bool ViewWindow::isInRepeatPlay(void)const
{
return mIsInRepeatPlay;
}
inline
void ViewWindow::isInRepeatPlay(bool isInRepeatPlay)
{
mIsInRepeatPlay=isInRepeatPlay;
}
inline
const String &ViewWindow::getPathFileProject(void)const
{
return mTablature.getPathFileProject();
}
inline
int ViewWindow::getNumTabEntries(void)const
{
return ((SmartPointer<TabPage>&)mTabPage)->getEntries().size();
}
inline
void ViewWindow::setStatusControlRef(SmartPointer<StatusBarEx> &statusBar)
{
mTabPage->setStatusControlRef(statusBar);
}
*/
#endif

BIN
drums/drums.aps Normal file

Binary file not shown.

130
drums/drums.dsp Normal file
View File

@@ -0,0 +1,130 @@
# Microsoft Developer Studio Project File - Name="drums" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=drums - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "drums.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "drums.mak" CFG="drums - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "drums - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "drums - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "drums - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
!ELSEIF "$(CFG)" == "drums - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /Gz /MTd /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "STRICT" /D "__FLAT__" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comctl32.lib version.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "drums - Win32 Release"
# Name "drums - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\DrumControl.cpp
# End Source File
# Begin Source File
SOURCE=.\drums.rc
# End Source File
# Begin Source File
SOURCE=.\main.cpp
# End Source File
# Begin Source File
SOURCE=.\mainfrm.cpp
# End Source File
# Begin Source File
SOURCE=.\ViewWnd.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\harrow.cur
# End Source File
# Begin Source File
SOURCE=.\icon1.ico
# End Source File
# End Group
# End Target
# End Project

104
drums/drums.dsw Normal file
View File

@@ -0,0 +1,104 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "bsptree"=..\bsptree\bsptree.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "common"=..\common\common.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "drums"=.\drums.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name common
End Project Dependency
Begin Project Dependency
Project_Dep_Name toolbar
End Project Dependency
Begin Project Dependency
Project_Dep_Name statbar
End Project Dependency
Begin Project Dependency
Project_Dep_Name thread
End Project Dependency
Begin Project Dependency
Project_Dep_Name bsptree
End Project Dependency
}}}
###############################################################################
Project: "statbar"=..\statbar\Statbar.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "thread"=..\thread\thread.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "toolbar"=..\toolbar\Toolbar.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

40
drums/drums.h Normal file
View File

@@ -0,0 +1,40 @@
#ifndef _DRUMS_DRUMS_H_
#define _DRUMS_DRUMS_H_
#include "windows.h"
//
#define IDC_STATIC -1
// CURSOR
#define HARROW 1000
#define APPACCELERATORS 10000
#define MENU_FILE_EXIT 10000
#define MENU_FILE_NEW 10001
#define MENU_FILE_OPEN 10002
#define MENU_EDIT_CUT 12000
#define MENU_EDIT_COPY 12001
#define MENU_EDIT_PASTE 12002
// STRINGS
#define IDM_CASCADE 10014
#define IDM_TILE 10015
#define IDM_ARRANGE 10016
#define IDM_CLOSEALL 10017
#define IDM_MINIMIZEALL 10018
#define IDM_RESTOREALL 10019
// STRINGTABLE
#define STRING_DRUMVIEWWINDOWCLASSNAME 20000
#endif

6
drums/drums.hpp Normal file
View File

@@ -0,0 +1,6 @@
#ifndef _DRUMS_DRUMS_HPP_
#define _DRUMS_DRUMS_HPP_
#ifndef _DRUMS_DRUMS_H_
#include <drums/drums.h>
#endif
#endif

BIN
drums/drums.ncb Normal file

Binary file not shown.

BIN
drums/drums.opt Normal file

Binary file not shown.

47
drums/drums.plg Normal file
View File

@@ -0,0 +1,47 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: drums - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\sean\LOCALS~1\Temp\RSP2.tmp" with contents
[
/nologo /Gz /MTd /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "STRICT" /D "__FLAT__" /Fp"Debug/drums.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
"D:\work\drums\DrumControl.cpp"
"D:\work\drums\mainfrm.cpp"
"D:\work\drums\ViewWnd.cpp"
]
Creating command line "cl.exe @C:\DOCUME~1\sean\LOCALS~1\Temp\RSP2.tmp"
Creating temporary file "C:\DOCUME~1\sean\LOCALS~1\Temp\RSP3.tmp" with contents
[
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comctl32.lib version.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/drums.pdb" /debug /machine:I386 /out:"Debug/drums.exe" /pdbtype:sept
.\Debug\DrumControl.obj
.\Debug\main.obj
.\Debug\mainfrm.obj
.\Debug\ViewWnd.obj
.\Debug\drums.res
\work\exe\mscommon.lib
\work\exe\toolbar.lib
\work\exe\statbar.lib
\work\exe\msthread.lib
\work\exe\msbsp.lib
]
Creating command line "link.exe @C:\DOCUME~1\sean\LOCALS~1\Temp\RSP3.tmp"
<h3>Output Window</h3>
Compiling...
DrumControl.cpp
mainfrm.cpp
ViewWnd.cpp
Linking...
LINK : LNK6004: Debug/drums.exe not found or not built by the last incremental link; performing full link
Creating library Debug/drums.lib and object Debug/drums.exp
<h3>Results</h3>
drums.exe - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

239
drums/drums.rc Normal file
View File

@@ -0,0 +1,239 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "drums\drums.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
MAGENTA BITMAP DISCARDABLE "MAGENTA.BMP"
/////////////////////////////////////////////////////////////////////////////
//
// Cursor
//
HARROW CURSOR DISCARDABLE "HARROW.CUR"
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
APP_ICON ICON DISCARDABLE "icon1.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
MAINMENU MENU DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&New\tCtrl+N", MENU_FILE_NEW
MENUITEM "E&xit", MENU_FILE_EXIT
END
END
VIEWMENU MENU DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&New\tCtrl+N", MENU_FILE_NEW
MENUITEM "E&xit", MENU_FILE_EXIT
END
POPUP "&Edit"
BEGIN
MENUITEM "Cu&t...\tCtrl+X", MENU_EDIT_CUT
MENUITEM "&Copy\tCtrl+C", MENU_EDIT_COPY
MENUITEM "&Paste\tCtrl+V", MENU_EDIT_PASTE
END
POPUP "&Window"
BEGIN
MENUITEM "&Cascade\tShift+F5", IDM_CASCADE
MENUITEM "&Tile\tShift+F4", IDM_TILE
MENUITEM "&Arrange &icons", IDM_ARRANGE
MENUITEM SEPARATOR
MENUITEM "Close &all", IDM_CLOSEALL
MENUITEM "Mi&nimize all", IDM_MINIMIZEALL
MENUITEM "&Restore all", IDM_RESTOREALL
END
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""drums\\drums.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "Drums.\0"
VALUE "CompanyName", "Diversified Software Solutions.\0"
VALUE "FileDescription", "Drums\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "Drums\0"
VALUE "LegalCopyright", "Copyright <20> 2002\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "Drums.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Drums\0"
VALUE "ProductVersion", "1, 0, 0, r\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
APPACCELERATORS ACCELERATORS DISCARDABLE
BEGIN
"X", MENU_EDIT_CUT, VIRTKEY, CONTROL, NOINVERT
"C", MENU_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
"V", MENU_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT
"N", MENU_FILE_NEW, VIRTKEY, CONTROL, NOINVERT
"O", MENU_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT
VK_F5, IDM_CASCADE, VIRTKEY, NOINVERT
VK_F4, IDM_TILE, VIRTKEY, NOINVERT
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,129,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
GROUPBOX "Static",IDC_STATIC,45,19,48,40
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_DIALOG1, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 88
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
STRING_DRUMVIEWWINDOWCLASSNAME "DRUMVIEWCLASS"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

BIN
drums/harrow.cur Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
drums/icon1.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

43
drums/main.cpp Normal file
View File

@@ -0,0 +1,43 @@
#include <common/windows.hpp>
#include <common/versioninfo.hpp>
#include <common/clipbrd.hpp>
#include <drums/mainfrm.hpp>
#include <drums/drums.hpp>
//#include <guitar/globaldefs.hpp>
//#include <guitar/guitar.hpp>
//#include <guitar/splash.hpp>
//#include <guitar/MessageBox.hpp>
//#include <guitar/Registration.hpp>
int PASCAL WinMain(HINSTANCE /*hInstance*/,HINSTANCE /*hPrevInstance*/,LPSTR lpszCmdLine,int /*nCmdShow*/)
{
MainFrame mainFrame;
VersionInfo versionInfo;
/* VersionInfo versionInfo;
String strCommandLine;
strCommandLine=lpszCmdLine;
if(strCommandLine=="GENPERM")
{
Registration::getInstance().generatePermanentLicense();
SplashScreen splash("GUITAR","2002 - Diversified Software Solutions. \"http:\\www.diversified-software.com\"",versionInfo.getProductNameString()+String(" ")+versionInfo.getProductVersion());
splash.perform();
}
else if(!(strCommandLine=="NOLOGO"))
{
SplashScreen splash("GUITAR","2002 - Diversified Software Solutions. \"http:\\www.diversified-software.com\"",versionInfo.getProductNameString()+String(" ")+versionInfo.getProductVersion());
splash.perform();
}
// GlobalDefs::setLogLevel(GlobalDefs::Verbose);
GlobalDefs::setLogLevel(GlobalDefs::NoLog);
GlobalDefs::setRegisteredClipboardFormat(Clipboard::registerClipboardFormat(String("[")+versionInfo.getProductNameString()+String(",")+versionInfo.getProductVersion()+String("]")));
GlobalDefs::outDebug("Application started.");
GlobalDefs::outDebug("Creating main window.",GlobalDefs::Info);
*/
mainFrame.createWindow("Drums",versionInfo.getProductNameString()+String(" ")+versionInfo.getProductVersion(),"mainMenu","APP_ICON");
// GlobalDefs::outDebug("Loading accelerators.",GlobalDefs::Info);
mainFrame.loadAccelerators(APPACCELERATORS);
return mainFrame.messageLoop();
}

1066
drums/mainfrm.cpp Normal file

File diff suppressed because it is too large Load Diff

109
drums/mainfrm.hpp Normal file
View File

@@ -0,0 +1,109 @@
#ifndef _DRUMS_MAINFRAME_HPP_
#define _DRUMS_MAINFRAME_HPP_
#ifndef _COMMON_MDIFRM_HPP_
#include <common/mdifrm.hpp>
#endif
#ifndef _COMMON_STRING_HPP_
#include <common/string.hpp>
#endif
#ifndef _TOOLBAR_TOOLBAR_HPP_
#include <toolbar/toolbar.hpp>
#endif
class StatusBarEx;
class ViewWindow;
class MainFrame : public FrameWindow
{
public:
MainFrame(void);
virtual ~MainFrame();
protected:
virtual void mdiDestroy(MDIWindow &mdiWindow);
virtual void mdiActivate(MDIWindow &mdiWindow);
virtual void mdiDeactivate(MDIWindow &mdiWindow);
virtual bool preDestroy(MDIWindow &mdiWindow);
virtual void preRegister(WNDCLASS &wndClass);
private:
enum{StatusBarID=101,ToolBarID=501,StartDynamicID=30000};
enum{InitialWidth=800,InitialHeight=600};
CallbackData::ReturnType closeHandler(CallbackData &someCallbackData);
CallbackData::ReturnType queryEndSessionHandler(CallbackData &someCallbackData);
CallbackData::ReturnType paintHandler(CallbackData &someCallbackData);
CallbackData::ReturnType destroyHandler(CallbackData &someCallbackData);
CallbackData::ReturnType commandHandler(CallbackData &someCallbackData);
CallbackData::ReturnType keyDownHandler(CallbackData &someCallbackData);
CallbackData::ReturnType sizeHandler(CallbackData &someCallbackData);
CallbackData::ReturnType createHandler(CallbackData &someCallbackData);
CallbackData::ReturnType lineHandler(CallbackData &someCallbackData);
CallbackData::ReturnType guiFretboardHandler(CallbackData &someCallbackData);
CallbackData::ReturnType dropFilesHandler(CallbackData &someCallbackData);
void insertHandlers(void);
void removeHandlers(void);
void createControls(const CallbackData &callbackData);
void handleFileExit(void);
void handleFileNew(void);
void handleFileOpen(void);
void createToolBar(void);
/*
bool isActive(SmartPointer<MDIWindow> &viewWindow,const String &strPathFileProject);
void openProjectView(const String &strPathProjectFile);
void createProjectView(const String &strPathTabFile);
void createProjectView(void);
void handleEntryProperties(void);
void handleFilePrint(void);
void handleOpenProject(CallbackData &callbackData);
void handleOpenProject(const String &strPathFileProject);
void handleFileImport(void);
void handleFileClose(void);
void handleFileSave(void);
void handleFileSaveAs(void);
void handleChordLookup(void);
void handleChordEnter(void);
void handleCut(void);
void handleCopy(void);
void handlePaste(void);
void createControls(const CallbackData &callbackData);
void insertHandlers(void);
void removeHandlers(void);
void handlePlayTablature(void);
void handlePlayTablatureFromCurrent(void);
void handlePlayRange(void);
void handlePlayRangeRepeated(void);
void handleStopPlay(void);
void handleViewFretboard(void);
void handlePlayRepeated(void);
void handleIncreaseTempo(void);
void handleDecreaseTempo(void);
void handleSettings(void);
void handleSetEndRange(void);
void handleSetStartRange(void);
void handleEditRanges(void);
void handleShowScales(void);
void handleClearFretboard(void);
void handleShowAllPositions(void);
void handleHelpAbout(void);
void handleHelpIndex(void);
void handleHelpApplyLicense(void);
void handleHistogram(void);
void applyHistory(PureMenu &menu);
void updateHistory(const String &pathFileName);
void updateHistory(void);
void removeHistory(PureMenu &pureMenu);
bool validateLicense(void)const;
*/
Callback<MainFrame> mPaintHandler;
Callback<MainFrame> mDestroyHandler;
Callback<MainFrame> mCommandHandler;
Callback<MainFrame> mKeyDownHandler;
Callback<MainFrame> mSizeHandler;
Callback<MainFrame> mCreateHandler;
Callback<MainFrame> mCloseHandler;
Callback<MainFrame> mQueryEndSessionHandler;
SmartPointer<StatusBarEx> mStatusControl;
ToolBar mToolBar;
};
#endif

17
drums/resource.h Normal file
View File

@@ -0,0 +1,17 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by drums.rc
//
#define APPICON 103
#define IDD_DIALOG1 108
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 109
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1088
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif