play_commands.h
上传用户:psq1974
上传日期:2007-01-06
资源大小:1195k
文件大小:1k
- /* Copyright (C) 1998, 1999 State University of New York at Stony Brook
- Author: Andrew V. Shuvalov ( andrew@ecsl.cs.sunysb.edu )
- Software license is located in file "COPYING"
- */
- #ifndef _play_commands_h_
- #define _play_commands_h_
- const char _play_cmd_[] = "play";
- const char _stop_cmd_[] = "stop";
- //const char _broadcast_cmd_[] = "stop";
- /** those commands are described in file TextProtocol.java */
- const char _set_filename_[] = "setfilename";
- const char _start_recording_[] = "startrecording";
- const char _stop_recording_[] = "stoprecording";
- const char _accept_stream_[] = "acceptstream";
- const char _add_broadcast_destination_[] = "addbroadcastdestination";
- const char _push_server_ok_[] = "pushserverok";
- /** text pattern to convert date and time yyyy-MM-dd HH:mm:ss */
- const char _play_time_format_[] = "%04d-%02d-%02d %02d:%02d:%02d";
- const char _play_time_sscanf_format_[] = "%04d-%02d-%02d %02d:%02d:%02d";
- inline void TIMETOSTR( char *buf, const struct tm t )
- {
- sprintf( buf, _play_time_format_, t.tm_year + 1900, t.tm_mon + 1,
- t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec );
- }
- inline void STRTOTIME( const char *buf, struct tm &t )
- {
- sscanf( buf, _play_time_sscanf_format_, &t.tm_year, &t.tm_mon,
- &t.tm_mday, &t.tm_hour, &t.tm_min, &t.tm_sec );
- t.tm_year -= 1900;
- t.tm_mon -= 1;
- }
- inline void TMTOTIMEVAL( const struct tm &t, struct timeval &tv )
- {
- tv.tv_sec = mktime( ( struct tm * ) &t );
- tv.tv_usec = 0;
- }
- #endif // _play_commands_h_