Server/Spec: Difference between revisions

From kJams Wiki
Jump to navigation Jump to search
p
 
No edit summary
Line 33: Line 33:
{ CWS_Path_SCRIPT_MAIN, "main.js" },
{ CWS_Path_SCRIPT_MAIN, "main.js" },
};
};
typedef enum {
CWS_OrderBy_NONE = -1,
CWS_OrderBy_INDEX,
CWS_OrderBy_NAME,
CWS_OrderBy_ARTIST,
CWS_OrderBy_ALBUM,
CWS_OrderBy_PITCH,
CWS_OrderBy_NUMTYPES
} CWS_OrderByType;
</pre>
</pre>


Line 45: Line 57:
CWS_Path_HELP shows the help screen.
CWS_Path_HELP shows the help screen.


CWS_Path_NEW_SINGER requires as params: "singername", "password", and singer password "confirm", it will then create a new singer, or return an error: that the singer name already exists, that no password was specified, or that the passwords don't match, then send the user to the singer's login screen.
CWS_Path_NEW_SINGER requires as params: kPostData_SUBMIT (empty string), kPostData_SINGER_NAME, kPostData_PASSWORD, and kPostData_PASSWORD_CONFIRM, it will then create a new singer, or return an error: that the singer name already exists, that no password was specified, or that the passwords don't match, then send the user to the singer's login screen. also pings.
 
CWS_Path_SINGERS returns a plist of all singers, so you can put them in a menu to choose from. also pings.


CWS_Path_SINGERS returns a plist of all singers, so you can put them in a menu to choose from.
CWS_Path_PLAYLISTS only works if a singer is logged in, it returns the list of playlists that are owned by the singer.  currently there are three ("Tonight", "History" and "Favorites") but be prepared to show a variable number. also pings.


CWS_Path_PLAYLISTS only works if a singer is logged in, it returns the list of playlists that are owned by the singercurrently there are three ("Tonight", "History" and "Favorites") but be prepared to show a variable number.
CWS_Path_SONGS singer must be logged in, requires params: kPostData_PLAYLIST (name), kPostData_ORDER_BY (CWS_OrderByType), kPostData_SEARCH (search string).  returns a plist containing the songs in the playlist.  also pingsmust send some search string to get a list of songs.

Revision as of 19:57, 30 October 2011

#define		kPostData_SINGER			"singer"
#define		kPostData_SINGER_NAME			"singername"
#define		kPostData_PASSWORD			"password"
#define		kPostData_PASSWORD_CONFIRM		"confirm"
#define		kPostData_SUBMIT			"submit"
#define		kPostData_PLAYLIST			"playlist"
#define		kPostData_ORDER_BY			"orderby"
#define		kPostData_SEARCH			"search"
#define		kPostData_PITCH				"pitch"
#define		kPostData_SONG				"song"
#define		kPostData_INDEX				"index"
#define		kPostData_INDEX_OLD			"oldIndex"
#define		kPostData_PLI				"piIx"		// Play List Item index
#define		kPostData_ERROR				"error"

CWS_StringTable		g_CWS_StringTable[] = {
	{	CWS_Path_NONE,				"nothing"				}, 
	{	CWS_Path_PING,				"ping"					},
	{	CWS_Path_LOGIN,				""					}, 
	{	CWS_Path_LOGOUT,			"logout"				}, 
	{	CWS_Path_MAIN,				"main"					}, 
	{	CWS_Path_HELP,				"help"					}, 
	{	CWS_Path_NEW_SINGER,			"newsinger"				},
	{	CWS_Path_SINGERS,			"singers"				}, 
	{	CWS_Path_PLAYLISTS,			"playlists"				}, 
	{	CWS_Path_SONGS,				"songs"					}, 
	{	CWS_Path_SEARCH,			"search"				}, 
	{	CWS_Path_DROP,				"drop"					}, 
	{	CWS_Path_REORDER,			"rearrange"				},
	{	CWS_Path_REMOVE,			"remove"				},
	{	CWS_Path_PITCH,				kPostData_PITCH				},
	{	CWS_Path_SCRIPT_MAIN,			"main.js"				},
};

typedef enum {
	CWS_OrderBy_NONE = -1, 

	CWS_OrderBy_INDEX, 
	CWS_OrderBy_NAME, 
	CWS_OrderBy_ARTIST, 
	CWS_OrderBy_ALBUM, 
	CWS_OrderBy_PITCH, 

	CWS_OrderBy_NUMTYPES
} CWS_OrderByType;

You may use Bonjour to discover the web server and port.

send a CWS_Path_PING periodically so the session does not time out (the app let's the KJ set a timeout to whatever they want, so 30 seconds is probably a good period)

CWS_Path_LOGIN revokes whatever auth had been established, and CWS_Path_LOGOUT will clear any cookies, then they both send you to the login screen.

CWS_Path_MAIN will do one of three things: if the singer is logged in, it goes to the singer's main screen. If the singer is NOT logged in but CAN be authenticated, it logs the singer in, then sends to the singer's main screen. otherwise, it goes to the login screen. it also does a ping.

CWS_Path_HELP shows the help screen.

CWS_Path_NEW_SINGER requires as params: kPostData_SUBMIT (empty string), kPostData_SINGER_NAME, kPostData_PASSWORD, and kPostData_PASSWORD_CONFIRM, it will then create a new singer, or return an error: that the singer name already exists, that no password was specified, or that the passwords don't match, then send the user to the singer's login screen. also pings.

CWS_Path_SINGERS returns a plist of all singers, so you can put them in a menu to choose from. also pings.

CWS_Path_PLAYLISTS only works if a singer is logged in, it returns the list of playlists that are owned by the singer. currently there are three ("Tonight", "History" and "Favorites") but be prepared to show a variable number. also pings.

CWS_Path_SONGS singer must be logged in, requires params: kPostData_PLAYLIST (name), kPostData_ORDER_BY (CWS_OrderByType), kPostData_SEARCH (search string). returns a plist containing the songs in the playlist. also pings. must send some search string to get a list of songs.