Click here to Skip to main content
15,886,844 members
Articles / Programming Languages / Objective C

Running State Machine Based Win32/WinCE Programs

Rate me:
Please Sign up or sign in to vote.
4.37/5 (9 votes)
17 May 20065 min read 70.7K   1.3K   35  
This article describes how to run state machine application framework based Win32/WinCE programs using the window message hooking technology. (Open source project)
/*
FILE: MediaPlay.c
NOTE: The State Machine Wizard will add mapping macros between /*{{ and /*}}. Do NOT modify manually.
*/

#include "stdafx.h"
#include "PlayerEventId.h"
#include "sme.h"
#include "MediaPlay.h"

SME_BEGIN_STATE_DEF(MediaPlay,MediaPlay)
	/*{{SME_STATE_DEF(MediaPlay,MediaPlay)*/
	SME_STATE_ENTRY_FUNC(MediaPlayEntry)
	SME_STATE_EXIT_FUNC(MediaPlayExit)
	/*}}SME_STATE_DEF*/
SME_END_STATE_DEF

SME_BEGIN_STATE_DEF(MediaPlay,Stop)
	/*{{SME_STATE_DEF(MediaPlay,Stop)*/
	SME_STATE_ENTRY_FUNC(StopEntry)
	SME_STATE_EXIT_FUNC(StopExit)
	SME_ON_EVENT(EVENT_PLAY_START,OnStopEVENT_PLAY_START,Play)
	/*}}SME_STATE_DEF*/
SME_END_STATE_DEF

SME_BEGIN_STATE_DEF(MediaPlay,Play)
	/*{{SME_STATE_DEF(MediaPlay,Play)*/
	SME_STATE_ENTRY_FUNC(PlayEntry)
	SME_STATE_EXIT_FUNC(PlayExit)
	SME_ON_EVENT(EVENT_PLAY_STOP,OnPlayEVENT_PLAY_STOP,Stop)
	/*}}SME_STATE_DEF*/
SME_END_STATE_DEF

/*{{SME_STATE_STATETREE_SEPARATOR}}*/

SME_BEGIN_STATE_TREE_DEF(MediaPlay)
	/*{{SME_STATE_TREE_DEF(MediaPlay)*/
	SME_STATE(MediaPlay,MediaPlay,SME_INVALID_STATE,Stop)
	SME_STATE(MediaPlay,Stop,0,-1)
	SME_STATE(MediaPlay,Play,0,-1)
	/*}}SME_STATE_TREE_DEF*/
SME_END_STATE_TREE_DEF

/*{{SME_DEC_IMP_SEPARATOR}}*/

SME_APPLICATION_DEF(MediaPlay, "MediaPlay")

int MediaPlayEntry(struct SME_APP_T *pApp, struct SME_EVENT_T *pEvent)
{
	return 0;
}

int MediaPlayExit(struct SME_APP_T *pApp, struct SME_EVENT_T *pEvent)
{
	return 0;
}


int StopEntry(struct SME_APP_T *pApp, struct SME_EVENT_T *pEvent)
{
	return 0;
}


int StopExit(struct SME_APP_T *pApp, struct SME_EVENT_T *pEvent)
{
	return 0;
}


int PlayEntry(struct SME_APP_T *pApp, struct SME_EVENT_T *pEvent)
{
	return 0;
}


int PlayExit(struct SME_APP_T *pApp, struct SME_EVENT_T *pEvent)
{
	return 0;
}


int OnStopEVENT_PLAY_START(struct SME_APP_T *pApp, struct SME_EVENT_T *pEvent)
{
	return 0;
}


int OnPlayEVENT_PLAY_STOP(struct SME_APP_T *pApp, struct SME_EVENT_T *pEvent)
{
	return 0;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


Written By
Web Developer
China China
Jerome. (Free to speak, free to use.)

Comments and Discussions