Constants.h 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  1. /*
  2. ==============================================================================
  3. Constants.h
  4. Created: 24 May 2014 11:41:00am
  5. Author: me
  6. ==============================================================================
  7. */
  8. #ifndef _CONSTANTS_H_
  9. #define _CONSTANTS_H_
  10. #include <ninjam/audiostream.h>
  11. #include <ninjam/njclient.h>
  12. #include "JuceHeader.h"
  13. /*\ CAVEATS:
  14. |*| when adding GUI components to Channels be sure to update N_STATIC_CHANNELS_CHILDREN
  15. |*| and when adding GUI components to Mixer be sure to update N_STATIC_MIXER_CHILDREN
  16. |*| or else segfault is a near certainty
  17. |*|
  18. |*| when adding nodes or properties to CONFIG_XML be sure to
  19. |*| * document them in LinJamConfig.h
  20. |*| * denote property datatypes in #define CONFIG_TYPES_XML
  21. |*| * switch on nodes in LinJamConfig::restoreVarTypeInfo()
  22. |*| * verify nodes in LinJamConfig::sanityCheck()
  23. |*| * if channel property - verify data in LinJamConfig::sanityCheckChannels()
  24. |*| and add to LinJamConfig::newChannel()
  25. |*| * optionally dump data or errors in #define DEBUG_TRACE_SANITY_CHECK
  26. |*| #define DEBUG_TRACE_SANITY_CHECK_CHANNEL
  27. |*| #define DEBUG_TRACE_ADD_CHANNEL_GUI
  28. |*| #define DEBUG_TRACE_CONFIGURE_LOCAL_CHANNEL
  29. |*| #define DEBUG_TRACE_REMOTE_CHANNELS
  30. |*| #define DEBUG_TRACE_CONFIGURE_REMOTE
  31. \*/
  32. #define CONFIG_XML "<?xml version=\"1.0\"?><" + \
  33. PERSISTENCE_KEY + "><" + \
  34. CLIENT_KEY + " " + \
  35. SAVE_AUDIO_MODE_KEY + "=\"" + String(DEFAULT_SAVE_AUDIO_MODE) + "\" " + \
  36. MIXDOWN_MODE_KEY + "=\"" + String(DEFAULT_MIXDOWN_MODE) + "\" " + \
  37. SHOULD_SAVE_LOG_KEY + "=\"" + String(DEFAULT_SHOULD_SAVE_LOG) + "\" " + \
  38. DEBUG_LEVEL_KEY + "=\"" + String(DEFAULT_DEBUG_LEVEL) + "\" " + \
  39. SHOULD_HIDE_BOTS_KEY + "=\"" + String(DEFAULT_SHOULD_HIDE_BOTS) + "\" " + \
  40. "/><" + \
  41. SUBSCRIPTIONS_KEY + " " + \
  42. SUBSCRIBE_MODE_KEY + "=\"" + String(DEFAULT_SUBSCRIBE_MODE) + "\" " + \
  43. "/><" + \
  44. AUDIO_KEY + " " + \
  45. WIN_AUDIO_IF_KEY + "=\"" + String(DEFAULT_WIN_AUDIO_IF) + "\" " + \
  46. ASIO_DRIVER_KEY + "=\"" + String(DEFAULT_ASIO_DRIVER) + "\" " + \
  47. ASIO_INPUT0_KEY + "=\"" + String(DEFAULT_ASIO_INPUT0) + "\" " + \
  48. ASIO_INPUT1_KEY + "=\"" + String(DEFAULT_ASIO_INPUT1) + "\" " + \
  49. ASIO_OUTPUT0_KEY + "=\"" + String(DEFAULT_ASIO_OUTPUT0) + "\" " + \
  50. ASIO_OUTPUT1_KEY + "=\"" + String(DEFAULT_ASIO_OUTPUT1) + "\" " + \
  51. KS_INPUT_KEY + "=\"" + String(DEFAULT_KS_INPUT) + "\" " + \
  52. KS_OUTPUT_KEY + "=\"" + String(DEFAULT_KS_OUTPUT) + "\" " + \
  53. KS_BITDEPTH_KEY + "=\"" + String(DEFAULT_KS_BITDEPTH) + "\" " + \
  54. KS_SAMPLERATE_KEY + "=\"" + String(DEFAULT_KS_SAMPLERATE) + "\" " + \
  55. KS_BLOCKSIZE_KEY + "=\"" + String(DEFAULT_KS_BLOCKSIZE) + "\" " + \
  56. KS_NBLOCKS_KEY + "=\"" + String(DEFAULT_KS_N_BLOCKS) + "\" " + \
  57. DS_INPUT0_KEY + "=\"" + String(DEFAULT_DS_INPUT0) + "\" " + \
  58. DS_INPUT1_KEY + "=\"" + String(DEFAULT_DS_INPUT1) + "\" " + \
  59. DS_INPUT2_KEY + "=\"" + String(DEFAULT_DS_INPUT2) + "\" " + \
  60. DS_INPUT3_KEY + "=\"" + String(DEFAULT_DS_INPUT3) + "\" " + \
  61. DS_OUTPUT0_KEY + "=\"" + String(DEFAULT_DS_OUTPUT0) + "\" " + \
  62. DS_OUTPUT1_KEY + "=\"" + String(DEFAULT_DS_OUTPUT1) + "\" " + \
  63. DS_OUTPUT2_KEY + "=\"" + String(DEFAULT_DS_OUTPUT2) + "\" " + \
  64. DS_OUTPUT3_KEY + "=\"" + String(DEFAULT_DS_OUTPUT3) + "\" " + \
  65. DS_BITDEPTH_KEY + "=\"" + String(DEFAULT_DS_BITDEPTH) + "\" " + \
  66. DS_SAMPLERATE_KEY + "=\"" + String(DEFAULT_DS_SAMPLERATE) + "\" " + \
  67. DS_BLOCKSIZE_KEY + "=\"" + String(DEFAULT_DS_BLOCKSIZE) + "\" " + \
  68. DS_NBLOCKS_KEY + "=\"" + String(DEFAULT_DS_N_BLOCKS) + "\" " + \
  69. WAVE_INPUT_KEY + "=\"" + String(DEFAULT_WAVE_INPUT) + "\" " + \
  70. WAVE_OUTPUT_KEY + "=\"" + String(DEFAULT_WAVE_OUTPUT) + "\" " + \
  71. WAVE_BITDEPTH_KEY + "=\"" + String(DEFAULT_WAVE_BITDEPTH) + "\" " + \
  72. WAVE_SAMPLERATE_KEY + "=\"" + String(DEFAULT_WAVE_SAMPLERATE) + "\" " + \
  73. WAVE_BLOCKSIZE_KEY + "=\"" + String(DEFAULT_WAVE_BLOCKSIZE) + "\" " + \
  74. WAVE_NBLOCKS_KEY + "=\"" + String(DEFAULT_WAVE_N_BLOCKS) + "\" " + \
  75. MAC_DEVICE_KEY + "=\"" + String(DEFAULT_MAC_DEVICE) + "\" " + \
  76. MAC_NINPUTS_KEY + "=\"" + String(DEFAULT_N_INPUTS) + "\" " + \
  77. MAC_BITDEPTH_KEY + "=\"" + String(DEFAULT_MAC_BITDEPTH) + "\" " + \
  78. MAC_SAMPLERATE_KEY + "=\"" + String(DEFAULT_MAC_SAMPLERATE) + "\" " + \
  79. NIX_AUDIO_IF_KEY + "=\"" + String(DEFAULT_NIX_AUDIO_IF) + "\" " + \
  80. JACK_SERVER_KEY + "=\"" + String(DEFAULT_JACK_SERVER) + "\" " + \
  81. JACK_NAME_KEY + "=\"" + String(DEFAULT_JACK_NAME) + "\" " + \
  82. JACK_NINPUTS_KEY + "=\"" + String(DEFAULT_N_INPUTS) + "\" " + \
  83. JACK_NOUTPUTS_KEY + "=\"" + String(DEFAULT_N_OUTPUTS) + "\" " + \
  84. ALSA_CONFIG_KEY + "=\"" + String(DEFAULT_ALSA_CONFIG) + "\" " + \
  85. "/><" + \
  86. SERVER_KEY + " " + \
  87. HOST_KEY + "=\"" + String(DEFAULT_HOST) + "\" " + \
  88. LOGIN_KEY + "=\"" + String(DEFAULT_LOGIN) + "\" " + \
  89. PASS_KEY + "=\"" + String(DEFAULT_PASS) + "\" " + \
  90. IS_ANONYMOUS_KEY + "=\"" + String(DEFAULT_IS_ANONYMOUS) + "\" " + \
  91. IS_AGREED_KEY + "=\"" + String(DEFAULT_IS_AGREED) + "\" " + \
  92. SHOULD_AGREE_KEY + "=\"" + String(DEFAULT_SHOULD_AGREE) + "\" " + \
  93. "/><" + \
  94. SERVERS_KEY + " /><" + \
  95. MASTERS_KEY + "><" + \
  96. MASTER_KEY + " " + \
  97. CHANNEL_NAME_KEY + "=\"" + String(MASTER_KEY) + "\" " + \
  98. VOLUME_KEY + "=\"" + String(DEFAULT_VOLUME) + "\" " + \
  99. PAN_KEY + "=\"" + String(DEFAULT_PAN) + "\" " + \
  100. IS_MUTED_KEY + "=\"" + String(DEFAULT_IS_MUTED) + "\" " + \
  101. STEREO_KEY + "=\"" + String(STEREO) + "\" " + \
  102. VU_LEFT_KEY + "=\"" + String(DEFAULT_VU) + "\" " + \
  103. VU_RIGHT_KEY + "=\"" + String(DEFAULT_VU) + "\" " + \
  104. "/><" + \
  105. METRO_KEY + " " + \
  106. CHANNEL_NAME_KEY + "=\"" + String(METRO_KEY) + "\" " + \
  107. VOLUME_KEY + "=\"" + String(DEFAULT_VOLUME) + "\" " + \
  108. PAN_KEY + "=\"" + String(DEFAULT_PAN) + "\" " + \
  109. IS_MUTED_KEY + "=\"" + String(DEFAULT_IS_MUTED) + "\" " + \
  110. SOURCE_N_KEY + "=\"" + String(DEFAULT_SOURCE_N) + "\" " + \
  111. STEREO_KEY + "=\"" + String(STEREO) + "\" " + \
  112. VU_LEFT_KEY + "=\"" + String(DEFAULT_VU) + "\" " + \
  113. VU_RIGHT_KEY + "=\"" + String(DEFAULT_VU) + "\" " + \
  114. "/>" + \
  115. "</" + MASTERS_KEY + "><" + \
  116. LOCALS_KEY + " /><" + \
  117. REMOTES_KEY + " />" + \
  118. "</" + PERSISTENCE_KEY + ">"
  119. #define CONFIG_TYPES_XML "<?xml version=\"1.0\"?><" + \
  120. PERSISTENCE_TYPES_KEY + "><" + \
  121. CLIENT_KEY + " " + \
  122. SAVE_AUDIO_MODE_KEY + "=\"" + INT_TYPE + "\" " + \
  123. MIXDOWN_MODE_KEY + "=\"" + INT_TYPE + "\" " + \
  124. SHOULD_SAVE_LOG_KEY + "=\"" + BOOL_TYPE + "\" " + \
  125. DEBUG_LEVEL_KEY + "=\"" + INT_TYPE + "\" " + \
  126. SHOULD_HIDE_BOTS_KEY + "=\"" + BOOL_TYPE + "\" " + \
  127. "/><" + \
  128. SUBSCRIPTIONS_KEY + " " + \
  129. SUBSCRIBE_MODE_KEY + "=\"" + INT_TYPE + "\" " + \
  130. "/><" + \
  131. AUDIO_KEY + " " + \
  132. WIN_AUDIO_IF_KEY + "=\"" + INT_TYPE + "\" " + \
  133. ASIO_DRIVER_KEY + "=\"" + INT_TYPE + "\" " + \
  134. ASIO_INPUT0_KEY + "=\"" + INT_TYPE + "\" " + \
  135. ASIO_INPUT1_KEY + "=\"" + INT_TYPE + "\" " + \
  136. ASIO_OUTPUT0_KEY + "=\"" + INT_TYPE + "\" " + \
  137. ASIO_OUTPUT1_KEY + "=\"" + INT_TYPE + "\" " + \
  138. KS_INPUT_KEY + "=\"" + INT_TYPE + "\" " + \
  139. KS_OUTPUT_KEY + "=\"" + INT_TYPE + "\" " + \
  140. KS_BITDEPTH_KEY + "=\"" + INT_TYPE + "\" " + \
  141. KS_SAMPLERATE_KEY + "=\"" + INT_TYPE + "\" " + \
  142. KS_NBLOCKS_KEY + "=\"" + INT_TYPE + "\" " + \
  143. KS_BLOCKSIZE_KEY + "=\"" + INT_TYPE + "\" " + \
  144. DS_INPUT0_KEY + "=\"" + INT_TYPE + "\" " + \
  145. DS_INPUT1_KEY + "=\"" + INT_TYPE + "\" " + \
  146. DS_INPUT2_KEY + "=\"" + INT_TYPE + "\" " + \
  147. DS_INPUT3_KEY + "=\"" + INT_TYPE + "\" " + \
  148. DS_OUTPUT0_KEY + "=\"" + INT_TYPE + "\" " + \
  149. DS_OUTPUT1_KEY + "=\"" + INT_TYPE + "\" " + \
  150. DS_OUTPUT2_KEY + "=\"" + INT_TYPE + "\" " + \
  151. DS_OUTPUT3_KEY + "=\"" + INT_TYPE + "\" " + \
  152. DS_BITDEPTH_KEY + "=\"" + INT_TYPE + "\" " + \
  153. DS_SAMPLERATE_KEY + "=\"" + INT_TYPE + "\" " + \
  154. DS_NBLOCKS_KEY + "=\"" + INT_TYPE + "\" " + \
  155. DS_BLOCKSIZE_KEY + "=\"" + INT_TYPE + "\" " + \
  156. WAVE_INPUT_KEY + "=\"" + INT_TYPE + "\" " + \
  157. WAVE_OUTPUT_KEY + "=\"" + INT_TYPE + "\" " + \
  158. WAVE_BITDEPTH_KEY + "=\"" + INT_TYPE + "\" " + \
  159. WAVE_SAMPLERATE_KEY + "=\"" + INT_TYPE + "\" " + \
  160. WAVE_NBLOCKS_KEY + "=\"" + INT_TYPE + "\" " + \
  161. WAVE_BLOCKSIZE_KEY + "=\"" + INT_TYPE + "\" " + \
  162. MAC_DEVICE_KEY + "=\"" + STRING_TYPE + "\" " + \
  163. MAC_NINPUTS_KEY + "=\"" + INT_TYPE + "\" " + \
  164. MAC_BITDEPTH_KEY + "=\"" + INT_TYPE + "\" " + \
  165. MAC_SAMPLERATE_KEY + "=\"" + INT_TYPE + "\" " + \
  166. NIX_AUDIO_IF_KEY + "=\"" + INT_TYPE + "\" " + \
  167. JACK_SERVER_KEY + "=\"" + INT_TYPE + "\" " + \
  168. JACK_NAME_KEY + "=\"" + STRING_TYPE + "\" " + \
  169. JACK_NINPUTS_KEY + "=\"" + INT_TYPE + "\" " + \
  170. JACK_NOUTPUTS_KEY + "=\"" + INT_TYPE + "\" " + \
  171. ALSA_CONFIG_KEY + "=\"" + STRING_TYPE + "\" " + \
  172. "/><" + \
  173. SERVER_KEY + " " + \
  174. HOST_KEY + "=\"" + STRING_TYPE + "\" " + \
  175. LOGIN_KEY + "=\"" + STRING_TYPE + "\" " + \
  176. PASS_KEY + "=\"" + STRING_TYPE + "\" " + \
  177. IS_ANONYMOUS_KEY + "=\"" + BOOL_TYPE + "\" " + \
  178. IS_AGREED_KEY + "=\"" + BOOL_TYPE + "\" " + \
  179. SHOULD_AGREE_KEY + "=\"" + BOOL_TYPE + "\" " + \
  180. "/><" + \
  181. USERS_KEY + " " + \
  182. USER_IDX_KEY + "=\"" + INT_TYPE + "\" " + \
  183. "/><" + \
  184. CHANNELS_KEY + " " + \
  185. CHANNEL_NAME_KEY + "=\"" + STRING_TYPE + "\" " + \
  186. CHANNEL_IDX_KEY + "=\"" + INT_TYPE + "\" " + \
  187. PAIR_IDX_KEY + "=\"" + INT_TYPE + "\" " + \
  188. VOLUME_KEY + "=\"" + DOUBLE_TYPE + "\" " + \
  189. PAN_KEY + "=\"" + DOUBLE_TYPE + "\" " + \
  190. IS_XMIT_RCV_KEY + "=\"" + BOOL_TYPE + "\" " + \
  191. IS_MUTED_KEY + "=\"" + BOOL_TYPE + "\" " + \
  192. IS_SOLO_KEY + "=\"" + BOOL_TYPE + "\" " + \
  193. SOURCE_N_KEY + "=\"" + INT_TYPE + "\" " + \
  194. STEREO_KEY + "=\"" + INT_TYPE + "\" " + \
  195. VU_LEFT_KEY + "=\"" + DOUBLE_TYPE + "\" " + \
  196. VU_RIGHT_KEY + "=\"" + DOUBLE_TYPE + "\" " + \
  197. "/>" + \
  198. "</" + PERSISTENCE_TYPES_KEY + ">"
  199. namespace CLIENT
  200. {
  201. // client
  202. static const String SERVER_FULL_STATUS = "server full" ;
  203. static const int BOT_USERIDX = 0 ;
  204. static const int BOT_CHANNELIDX = 0 ;
  205. static const uint8 CHATMSG_TYPE_IDX = 0 ;
  206. static const uint8 CHATMSG_USER_IDX = 1 ;
  207. static const uint8 CHATMSG_MSG_IDX = 2 ;
  208. // chat
  209. static const String CHATMSG_TYPE_TOPIC = "TOPIC" ;
  210. static const String CHATMSG_TYPE_MSG = "MSG" ;
  211. static const String CHATMSG_TYPE_PRIVMSG = "PRIVMSG" ;
  212. static const String CHATMSG_TYPE_JOIN = "JOIN" ;
  213. static const String CHATMSG_TYPE_PART = "PART" ;
  214. static const String CHATMSG_TYPE_ADMIN = "ADMIN" ;
  215. static const String CHATMSG_CMD_ME = "/me " ;
  216. static const String CHATMSG_CMD_MSG = "/msg " ;
  217. static const String CHATMSG_CMD_TOPIC = "/topic " ;
  218. static const String CHATMSG_CMD_KICK = "/kick " ;
  219. static const String CHATMSG_CMD_BPM = "/bpm " ;
  220. static const String CHATMSG_CMD_BPI = "/bpi " ;
  221. static const String CHATMSG_CMD_ADMIN = "/admin " ;
  222. static const StringRef CHATMSG_CMD_VOTE = "!vote " ;
  223. // main
  224. static const int CLIENT_TIMER_ID = 0 ; static const int CLIENT_DRIVER_IVL = 50 ;
  225. static const int GUI_TIMER_HI_ID = 1 ; static const int GUI_UPDATE_HI_IVL = 125 ;
  226. static const int GUI_TIMER_LO_ID = 2 ; static const int GUI_UPDATE_LO_IVL = 30000 ;
  227. // ConfigAudio options
  228. static const String ASIO_DEVICE_TYPE = "ASIO" ;
  229. static const String DS_DEVICE_TYPE = "DirectSound" ;
  230. static const String WASAPI_DEVICE_TYPE = "WASAPI" ;
  231. static const String CA_DEVICE_TYPE = "CoreAudio" ;
  232. static const String JACK_DEVICE_TYPE = "JACK" ;
  233. static const String ALSA_DEVICE_TYPE = "ALSA" ;
  234. static const String ROID_DEVICE_TYPE = "Android" ;
  235. static const String SLES_DEVICE_TYPE = "OpenSLES" ;
  236. static const String IOS_DEVICE_TYPE = "iOSAudio" ;
  237. static const String KS_DEVICE_TYPE = "Win32KernaelStreaming" ; // non-juce
  238. static const String WAVE_DEVICE_TYPE = "Win32Wave" ; // non-juce
  239. static const String NFG_DEVICE_TYPE = "unknown" ; // non-juce
  240. static const StringArray WIN_AUDIO_IFS =
  241. StringArray::fromLines(StringRef("asio\nkernel streaming\ndirect sound\nwave out")) ;
  242. static const StringArray NIX_AUDIO_IFS =
  243. StringArray::fromLines(StringRef("jack\nalsa")) ;
  244. static const StringArray BUFFER_SIZES =
  245. StringArray::fromLines(StringRef("32\n64\n128\n256\n512\n1024\n2048\n4096\n8192")) ;
  246. static const int BIT_DEPTH_16 = 16 ;
  247. static const int BIT_DEPTH_24 = 24 ;
  248. static const int BIT_DEPTH_32 = 32 ;
  249. static const int SAMPLE_RATE_44100 = 44100 ;
  250. static const int SAMPLE_RATE_48000 = 48000 ;
  251. static const int SAMPLE_RATE_96000 = 96000 ;
  252. static const int MIN_N_BUFFERS = 2 ;
  253. static const int MAX_N_BUFFERS = 16 ;
  254. static const int MIN_N_SOURCES = 0 ;
  255. static const int MAX_N_SOURCES = 16 ;
  256. static const int MIN_N_SINKS = 0 ;
  257. static const int MAX_N_SINKS = 16 ;
  258. static const double VU_DB_RANGE = 140.0 ;
  259. static const double VU_DB_MIN = -120.0 ;
  260. static const char* ASIO_DEVICE_FMT = "%d:%d,%d:%d,%d" ;
  261. // configuration
  262. static const String STEREO_L_POSTFIX = "-L" ;
  263. static const String STEREO_R_POSTFIX = "-R" ;
  264. static const int STEREO_POSTFIX_N_CHARS = STEREO_L_POSTFIX.length() ;
  265. }
  266. namespace NETWORK
  267. {
  268. // known hosts
  269. static const String LOCALHOST_HOSTNAME = "localhost" ;
  270. static const String LOCALHOST_2049_URL = LOCALHOST_HOSTNAME + ":2049" ;
  271. static const String NINJAM_2049_URL = "test-ninjam-com-2049" ;
  272. static const String NINJAM_2050_URL = "test.ninjam.com:2050" ;
  273. static const String NINJAM_2051_URL = "test.ninjam.com:2051" ;
  274. static const String NINJAM_2052_URL = "test.ninjam.com:2052" ;
  275. static const String NINJAM_2600_URL = "test.ninjam.com:2600" ;
  276. static const String NINJAM_2601_URL = "test.ninjam.com:2601" ;
  277. static const String NINBOT_2049_URL = "ninbot.com:2049" ;
  278. static const String NINBOT_2050_URL = "ninbot.com:2050" ;
  279. static const String NINBOT_2051_URL = "ninbot.com:2051" ;
  280. static const String NINBOT_2052_URL = "ninbot.com:2052" ;
  281. static const String NINJAMER_2049_URL = "ninjamer.com:2049" ;
  282. static const String NINJAMER_2050_URL = "ninjamer.com:2050" ;
  283. static const String NINJAMER_2051_URL = "ninjamer.com:2051" ;
  284. static const String NINJAMER_2052_URL = "ninjamer.com:2052" ;
  285. static const Identifier NINBOT_USER = "ninbot" ;
  286. static const Identifier JAMBOT_USER = "Jambot" ;
  287. static const int N_KNOWN_BOTS = 2 ;
  288. static const int N_KNOWN_HOSTS = 9 ;
  289. static const String known_hosts[N_KNOWN_HOSTS] = {
  290. LOCALHOST_2049_URL ,
  291. NINBOT_2049_URL ,
  292. NINBOT_2050_URL ,
  293. NINBOT_2051_URL ,
  294. NINBOT_2052_URL ,
  295. NINJAMER_2049_URL ,
  296. NINJAMER_2050_URL ,
  297. NINJAMER_2051_URL ,
  298. NINJAMER_2052_URL } ;
  299. static const Identifier known_bots[N_KNOWN_BOTS] = {
  300. NINBOT_USER ,
  301. JAMBOT_USER } ;
  302. static const Array<String> KNOWN_HOSTS =
  303. Array<String>( known_hosts , N_KNOWN_HOSTS) ;
  304. static const Array<Identifier> KNOWN_BOTS =
  305. Array<Identifier>(known_bots , N_KNOWN_BOTS) ;
  306. // login
  307. static const StringRef HOST_MASK = "*.*:*" ;
  308. static const StringRef LETTERS = "abcdefghijklmnopqrstuvwxyz" ;
  309. static const StringRef DIGITS = "0123456789" ;
  310. static const StringRef URL_CHARS = "0123456789abcdefghijklmnopqrstuvwxyz-." ;
  311. }
  312. namespace CONFIG
  313. {
  314. // config root keys
  315. static const String PERSISTENCE_FILENAME = "linjam.xml" ;
  316. static const String PERSISTENCE_KEY = "linjam-data" ;
  317. static const Identifier PERSISTENCE_ID = PERSISTENCE_KEY ;
  318. static const String PERSISTENCE_TYPES_KEY = PERSISTENCE_KEY + "-types" ;
  319. // client config keys
  320. static const String CLIENT_KEY = "client" ;
  321. static const Identifier CLIENT_ID = CLIENT_KEY ;
  322. static const String SAVE_AUDIO_MODE_KEY = "save-multitrack-mode" ;
  323. static const Identifier SAVE_AUDIO_MODE_ID = SAVE_AUDIO_MODE_KEY ;
  324. static const String MIXDOWN_MODE_KEY = "save-mixdown-mode" ;
  325. static const Identifier MIXDOWN_MODE_ID = MIXDOWN_MODE_KEY ;
  326. static const String SHOULD_SAVE_LOG_KEY = "should-save-log" ;
  327. static const Identifier SHOULD_SAVE_LOG_ID = SHOULD_SAVE_LOG_KEY ;
  328. static const String DEBUG_LEVEL_KEY = "debug-level" ;
  329. static const Identifier DEBUG_LEVEL_ID = DEBUG_LEVEL_KEY ;
  330. static const String SHOULD_HIDE_BOTS_KEY = "should-hide-bots" ;
  331. static const Identifier SHOULD_HIDE_BOTS_ID = SHOULD_HIDE_BOTS_KEY ;
  332. static const String SESSION_DIR_KEY = "session-dir" ;
  333. static const Identifier SESSION_DIR_ID = SESSION_DIR_KEY ;
  334. static const String LOG_FILE_KEY = "log-file" ;
  335. static const Identifier LOG_FILE_ID = LOG_FILE_KEY ;
  336. static const String SESSION_DIR = "/session" ;
  337. static const String LOG_FILE = "/clipsort.log" ;
  338. // subscriptions config keys
  339. static const String SUBSCRIPTIONS_KEY = "subscriptions" ;
  340. static const Identifier SUBSCRIPTIONS_ID = SUBSCRIPTIONS_KEY ;
  341. static const String SUBSCRIBE_MODE_KEY = "subscribe-mode" ;
  342. static const Identifier SUBSCRIBE_MODE_ID = SUBSCRIBE_MODE_KEY ;
  343. // audio device config keys
  344. static const String AUDIO_KEY = "audio" ;
  345. static const Identifier AUDIO_ID = AUDIO_KEY ;
  346. static const String WIN_AUDIO_IF_KEY = "win-audio-if-n" ;
  347. static const Identifier WIN_AUDIO_IF_ID = WIN_AUDIO_IF_KEY ;
  348. static const String ASIO_DRIVER_KEY = "asio-driver" ;
  349. static const Identifier ASIO_DRIVER_ID = ASIO_DRIVER_KEY ;
  350. static const String ASIO_INPUT0_KEY = "asio-input0" ;
  351. static const Identifier ASIO_INPUT0_ID = ASIO_INPUT0_KEY ;
  352. static const String ASIO_INPUT1_KEY = "asio-input1" ;
  353. static const Identifier ASIO_INPUT1_ID = ASIO_INPUT1_KEY ;
  354. static const String ASIO_OUTPUT0_KEY = "asio-output0" ;
  355. static const Identifier ASIO_OUTPUT0_ID = ASIO_OUTPUT0_KEY ;
  356. static const String ASIO_OUTPUT1_KEY = "asio-output1" ;
  357. static const Identifier ASIO_OUTPUT1_ID = ASIO_OUTPUT1_KEY ;
  358. static const String KS_INPUT_KEY = "ks-input" ;
  359. static const Identifier KS_INPUT_ID = KS_INPUT_KEY ;
  360. static const String KS_OUTPUT_KEY = "ks-output" ;
  361. static const Identifier KS_OUTPUT_ID = KS_OUTPUT_KEY ;
  362. static const String KS_SAMPLERATE_KEY = "ks-sample-rate" ;
  363. static const Identifier KS_SAMPLERATE_ID = KS_SAMPLERATE_KEY ;
  364. static const String KS_BITDEPTH_KEY = "ks-bit-depth" ;
  365. static const Identifier KS_BITDEPTH_ID = KS_BITDEPTH_KEY ;
  366. static const String KS_BLOCKSIZE_KEY = "ks-block-size" ;
  367. static const Identifier KS_BLOCKSIZE_ID = KS_BLOCKSIZE_KEY ;
  368. static const String KS_NBLOCKS_KEY = "ks-n-blocks" ;
  369. static const Identifier KS_NBLOCKS_ID = KS_NBLOCKS_KEY ;
  370. static const String DS_INPUT0_KEY = "ds-input0" ;
  371. static const Identifier DS_INPUT0_ID = DS_INPUT0_KEY ;
  372. static const String DS_INPUT1_KEY = "ds-input1" ;
  373. static const Identifier DS_INPUT1_ID = DS_INPUT1_KEY ;
  374. static const String DS_INPUT2_KEY = "ds-input2" ;
  375. static const Identifier DS_INPUT2_ID = DS_INPUT2_KEY ;
  376. static const String DS_INPUT3_KEY = "ds-input3" ;
  377. static const Identifier DS_INPUT3_ID = DS_INPUT3_KEY ;
  378. static const String DS_OUTPUT0_KEY = "ds-output0" ;
  379. static const Identifier DS_OUTPUT0_ID = DS_OUTPUT0_KEY ;
  380. static const String DS_OUTPUT1_KEY = "ds-output1" ;
  381. static const Identifier DS_OUTPUT1_ID = DS_OUTPUT1_KEY ;
  382. static const String DS_OUTPUT2_KEY = "ds-output2" ;
  383. static const Identifier DS_OUTPUT2_ID = DS_OUTPUT2_KEY ;
  384. static const String DS_OUTPUT3_KEY = "ds-output3" ;
  385. static const Identifier DS_OUTPUT3_ID = DS_OUTPUT3_KEY ;
  386. static const String DS_SAMPLERATE_KEY = "ds-sample-rate" ;
  387. static const Identifier DS_SAMPLERATE_ID = DS_SAMPLERATE_KEY ;
  388. static const String DS_BITDEPTH_KEY = "ds-bit-depth" ;
  389. static const Identifier DS_BITDEPTH_ID = DS_BITDEPTH_KEY ;
  390. static const String DS_BLOCKSIZE_KEY = "ds-block-size" ;
  391. static const Identifier DS_BLOCKSIZE_ID = DS_BLOCKSIZE_KEY ;
  392. static const String DS_NBLOCKS_KEY = "ds-n-blocks" ;
  393. static const Identifier DS_NBLOCKS_ID = DS_NBLOCKS_KEY ;
  394. static const String WAVE_INPUT_KEY = "wave-input" ;
  395. static const Identifier WAVE_INPUT_ID = WAVE_INPUT_KEY ;
  396. static const String WAVE_OUTPUT_KEY = "wave-output" ;
  397. static const Identifier WAVE_OUTPUT_ID = WAVE_OUTPUT_KEY ;
  398. static const String WAVE_SAMPLERATE_KEY = "wave-sample-rate" ;
  399. static const Identifier WAVE_SAMPLERATE_ID = WAVE_SAMPLERATE_KEY ;
  400. static const String WAVE_BITDEPTH_KEY = "wave-bit-depth" ;
  401. static const Identifier WAVE_BITDEPTH_ID = WAVE_BITDEPTH_KEY ;
  402. static const String WAVE_BLOCKSIZE_KEY = "wave-block-size" ;
  403. static const Identifier WAVE_BLOCKSIZE_ID = WAVE_BLOCKSIZE_KEY ;
  404. static const String WAVE_NBLOCKS_KEY = "wave-n-blocks" ;
  405. static const Identifier WAVE_NBLOCKS_ID = WAVE_NBLOCKS_KEY ;
  406. static const String MAC_DEVICE_KEY = "mac-device" ;
  407. static const Identifier MAC_DEVICE_ID = MAC_DEVICE_KEY ;
  408. static const String MAC_NINPUTS_KEY = "mac-n-inputs" ;
  409. static const Identifier MAC_NINPUTS_ID = MAC_NINPUTS_KEY ;
  410. static const String MAC_SAMPLERATE_KEY = "mac-sample-rate" ;
  411. static const Identifier MAC_SAMPLERATE_ID = MAC_SAMPLERATE_KEY ;
  412. static const String MAC_BITDEPTH_KEY = "mac-bit-depth" ;
  413. static const Identifier MAC_BITDEPTH_ID = MAC_BITDEPTH_KEY ;
  414. static const String NIX_AUDIO_IF_KEY = "nix-audio-if-n" ;
  415. static const Identifier NIX_AUDIO_IF_ID = NIX_AUDIO_IF_KEY ;
  416. static const String JACK_SERVER_KEY = "jack-server" ;
  417. static const Identifier JACK_SERVER_ID = JACK_SERVER_KEY ;
  418. static const String JACK_NAME_KEY = "jack-name" ;
  419. static const Identifier JACK_NAME_ID = JACK_NAME_KEY ;
  420. static const String JACK_NINPUTS_KEY = "jack-n-inputs" ;
  421. static const Identifier JACK_NINPUTS_ID = JACK_NINPUTS_KEY ;
  422. static const String JACK_NOUTPUTS_KEY = "jack-n-outputs" ;
  423. static const Identifier JACK_NOUTPUTS_ID = JACK_NOUTPUTS_KEY ;
  424. static const String ALSA_CONFIG_KEY = "alsa-config" ;
  425. static const Identifier ALSA_CONFIG_ID = ALSA_CONFIG_KEY ;
  426. // login config keys
  427. static const String SERVER_KEY = "server" ;
  428. static const Identifier SERVER_ID = SERVER_KEY ;
  429. static const String HOST_KEY = "host" ;
  430. static const Identifier HOST_ID = HOST_KEY ;
  431. static const String LOGIN_KEY = "login" ;
  432. static const Identifier LOGIN_ID = LOGIN_KEY ;
  433. static const String PASS_KEY = "pass" ;
  434. static const Identifier PASS_ID = PASS_KEY ;
  435. static const String IS_ANONYMOUS_KEY = "is-anonymous" ;
  436. static const Identifier IS_ANONYMOUS_ID = IS_ANONYMOUS_KEY ;
  437. static const String IS_AGREED_KEY = "is-agreed" ;
  438. static const Identifier IS_AGREED_ID = IS_AGREED_KEY ;
  439. static const String SHOULD_AGREE_KEY = "should-agree" ;
  440. static const Identifier SHOULD_AGREE_ID = SHOULD_AGREE_KEY ;
  441. static const String SERVERS_KEY = "servers" ;
  442. static const Identifier SERVERS_ID = SERVERS_KEY ;
  443. // channel config keys
  444. static const Identifier CONFIG_INIT_ID = "configure-all" ;
  445. static const String MASTERS_KEY = "master-channels" ;
  446. static const Identifier MASTERS_ID = MASTERS_KEY ;
  447. static const String MASTER_KEY = "master" ;
  448. static const Identifier MASTER_ID = MASTER_KEY ;
  449. static const String METRO_KEY = "metronome" ;
  450. static const Identifier METRO_ID = METRO_KEY ;
  451. static const String LOCALS_KEY = "local-channels" ;
  452. static const Identifier LOCALS_ID = LOCALS_KEY ;
  453. static const String REMOTES_KEY = "remote-channels" ;
  454. static const Identifier REMOTES_ID = REMOTES_KEY ;
  455. static const String USER_IDX_KEY = "user-idx" ;
  456. static const Identifier USER_IDX_ID = USER_IDX_KEY ;
  457. static const String CHANNEL_NAME_KEY = "channel-name" ;
  458. static const Identifier CHANNEL_NAME_ID = CHANNEL_NAME_KEY ;
  459. static const String CHANNEL_IDX_KEY = "channel-idx" ;
  460. static const Identifier CHANNEL_IDX_ID = CHANNEL_IDX_KEY ;
  461. static const String PAIR_IDX_KEY = "stereo-pair-idx" ;
  462. static const Identifier PAIR_IDX_ID = PAIR_IDX_KEY ;
  463. static const String VOLUME_KEY = "volume" ;
  464. static const Identifier VOLUME_ID = VOLUME_KEY ;
  465. static const String PAN_KEY = "pan" ;
  466. static const Identifier PAN_ID = PAN_KEY ;
  467. static const String IS_XMIT_RCV_KEY = "should-xmit-rcv" ;
  468. static const Identifier IS_XMIT_RCV_ID = IS_XMIT_RCV_KEY ;
  469. static const String IS_MUTED_KEY = "is-muted" ;
  470. static const Identifier IS_MUTED_ID = IS_MUTED_KEY ;
  471. static const String IS_SOLO_KEY = "is-solo" ;
  472. static const Identifier IS_SOLO_ID = IS_SOLO_KEY ;
  473. static const String SOURCE_N_KEY = "source-sink-n" ;
  474. static const Identifier SOURCE_N_ID = SOURCE_N_KEY ;
  475. static const String BIT_DEPTH_KEY = "bit-depth" ;
  476. static const Identifier BIT_DEPTH_ID = BIT_DEPTH_KEY ;
  477. static const String STEREO_KEY = "stereo-status" ;
  478. static const Identifier STEREO_ID = STEREO_KEY ;
  479. static const String VU_LEFT_KEY = "vu-left" ;
  480. static const Identifier VU_LEFT_ID = VU_LEFT_KEY ;
  481. static const String VU_RIGHT_KEY = "vu-right" ;
  482. static const Identifier VU_RIGHT_ID = VU_RIGHT_KEY ;
  483. // client config defaults
  484. static const int SAVE_AUDIO_ENUM_OFFSET = 2 ;
  485. static const int DEFAULT_SAVE_AUDIO_MODE = (int)NJClient::SAVE_AUDIO_DELETE_ASAP ;
  486. static const int DEFAULT_MIXDOWN_MODE = (int)NJClient::SAVE_MIXDOWN_NONE ;
  487. static const bool DEFAULT_SHOULD_SAVE_LOG = false ;
  488. static const int DEFAULT_DEBUG_LEVEL = (int)NJClient::DEBUG_LEVEL_SILENT ;
  489. // subscriptions config defaults
  490. static const int DEFAULT_SUBSCRIBE_MODE = (int)NJClient::SUBSCRIBE_DENY ;
  491. // audio config defaults
  492. static const int DEFAULT_N_INPUTS = (int)audioStreamer::DEFAULT_N_INPUTS ;
  493. static const int DEFAULT_N_OUTPUTS = (int)audioStreamer::DEFAULT_N_OUTPUTS ;
  494. static const int DEFAULT_SAMPLERATE = (int)audioStreamer::DEFAULT_SAMPLERATE ;
  495. static const int DEFAULT_BITDEPTH = (int)audioStreamer::DEFAULT_BITDEPTH ;
  496. static const int DEFAULT_WIN_AUDIO_IF = (int)audioStreamer::WIN_AUDIO_WAVE ;
  497. static const int DEFAULT_ASIO_DRIVER = 0 ;
  498. static const int DEFAULT_ASIO_INPUT0 = 0 ;
  499. static const int DEFAULT_ASIO_INPUT1 = 1 ;
  500. static const int DEFAULT_ASIO_OUTPUT0 = 0 ;
  501. static const int DEFAULT_ASIO_OUTPUT1 = 1 ;
  502. static const int DEFAULT_KS_INPUT = -1 ;
  503. static const int DEFAULT_KS_OUTPUT = -1 ;
  504. static const int DEFAULT_KS_BITDEPTH = DEFAULT_BITDEPTH ;
  505. static const int DEFAULT_KS_SAMPLERATE = DEFAULT_SAMPLERATE ;
  506. static const int DEFAULT_KS_N_BLOCKS = 8 ;
  507. static const int DEFAULT_KS_BLOCKSIZE = 512 ;
  508. static const int DEFAULT_DS_INPUT0 = 0 ;
  509. static const int DEFAULT_DS_INPUT1 = 0 ;
  510. static const int DEFAULT_DS_INPUT2 = 0 ;
  511. static const int DEFAULT_DS_INPUT3 = 0 ;
  512. static const int DEFAULT_DS_OUTPUT0 = 0 ;
  513. static const int DEFAULT_DS_OUTPUT1 = 0 ;
  514. static const int DEFAULT_DS_OUTPUT2 = 0 ;
  515. static const int DEFAULT_DS_OUTPUT3 = 0 ;
  516. static const int DEFAULT_DS_BITDEPTH = DEFAULT_BITDEPTH ;
  517. static const int DEFAULT_DS_SAMPLERATE = 44100 ;
  518. static const int DEFAULT_DS_N_BLOCKS = 16 ;
  519. static const int DEFAULT_DS_BLOCKSIZE = 1024 ;
  520. static const int DEFAULT_WAVE_INPUT = -1 ;
  521. static const int DEFAULT_WAVE_OUTPUT = -1 ;
  522. static const int DEFAULT_WAVE_BITDEPTH = DEFAULT_BITDEPTH ;
  523. static const int DEFAULT_WAVE_SAMPLERATE = 44100 ;
  524. static const int DEFAULT_WAVE_N_BLOCKS = 8 ;
  525. static const int DEFAULT_WAVE_BLOCKSIZE = 4096 ;
  526. static const String DEFAULT_MAC_DEVICE = "" ;
  527. static const int DEFAULT_MAC_BITDEPTH = DEFAULT_BITDEPTH ;
  528. static const int DEFAULT_MAC_SAMPLERATE = DEFAULT_SAMPLERATE ;
  529. static const int DEFAULT_NIX_AUDIO_IF = (int)audioStreamer::NIX_AUDIO_JACK ;
  530. static const int DEFAULT_JACK_SERVER = 0 ;
  531. static const String DEFAULT_JACK_NAME = "LinJam" ;
  532. static const String DEFAULT_ALSA_CONFIG = "" ;
  533. // login config defaults
  534. static const String DEFAULT_HOST = "" ;
  535. static const String DEFAULT_LOGIN = "" ;
  536. static const String DEFAULT_PASS = "" ;
  537. static const bool DEFAULT_IS_ANONYMOUS = true ;
  538. static const bool DEFAULT_IS_AGREED = false ;
  539. static const bool DEFAULT_SHOULD_AGREE = false ;
  540. static const bool DEFAULT_SHOULD_HIDE_BOTS = true ;
  541. // channel config defaults
  542. static const Identifier NEWCHANNEL_ID = "new-channel" ;
  543. static const String CHANNEL_BASE_ID = "channel" ;
  544. static const String CHANNELS_KEY = "channels" ;
  545. static const Identifier CHANNELS_ID = CHANNELS_KEY ;
  546. static const String USERS_KEY = "users" ;
  547. static const Identifier USERS_ID = USERS_KEY ;
  548. static const String DEFAULT_CHANNEL_NAME = "unnamed" ;
  549. static const int DEFAULT_CHANNEL_IDX = 42 ; // this is o/c outside bounds
  550. static const int MASTER_CHANNEL_IDX = DEFAULT_CHANNEL_IDX ;
  551. static const float DEFAULT_VOLUME = 0.0f ;
  552. static const float DEFAULT_PAN = 0.0f ;
  553. static const bool DEFAULT_IS_XMIT_RCV = true ;
  554. static const bool DEFAULT_IS_MUTED = false ;
  555. static const bool DEFAULT_IS_SOLO = false ;
  556. static const int DEFAULT_SOURCE_N = 0 ;
  557. static const int MONO = 0 ; // default NJClient mono
  558. static const int STEREO_L = -1 ; // faux-stereo pairs
  559. static const int STEREO_R = +1 ; // faux-stereo pairs
  560. static const int STEREO = 42 ; // masters and metro
  561. static const int DEFAULT_STEREO_STATUS = MONO ;
  562. static const double DEFAULT_VU = -120.0 ;
  563. // config types
  564. static const String BOOL_TYPE = "bool" ;
  565. static const String DOUBLE_TYPE = "double" ;
  566. static const String INT_TYPE = "int" ;
  567. static const String STRING_TYPE = "string" ;
  568. // validation
  569. static const StringRef VALID_NAME_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_- " ;
  570. static const StringRef USER_IP_SPLIT_CHAR = "@" ;
  571. // config storage
  572. static const String DEFAULT_CONFIG_XML = String(CONFIG_XML) ;
  573. static const String CONFIG_TYPES = String(CONFIG_TYPES_XML) ;
  574. }
  575. namespace GUI
  576. {
  577. // common
  578. static const int PAD = 4 ;
  579. static const int PAD2 = PAD * 2 ;
  580. static const int PAD3 = PAD * 3 ;
  581. static const int PAD4 = PAD * 4 ;
  582. // MainWindow
  583. static const String APP_NAME = "LinJam" ;
  584. static const int BORDERS_W = 2 ;
  585. static const int TITLEBAR_H = 24 ;
  586. static const int CONFIG_BTN_X = GUI::PAD ;
  587. static const int CONFIG_BTN_Y = 3 ;
  588. static const int CONFIG_BTN_W = GUI::TITLEBAR_H - GUI::PAD ;
  589. static const int CONFIG_BTN_H = GUI::TITLEBAR_H - GUI::PAD ;
  590. // MainContent
  591. static const String CONTENT_GUI_ID = "main-content-gui" ;
  592. static const int CONTENT_W = 640 - BORDERS_W ;
  593. static const int CONTENT_H = 480 - BORDERS_W - TITLEBAR_H ;
  594. // Background
  595. static const String BACKGROUND_GUI_ID = "background-gui" ;
  596. // Config
  597. static const String DISMISS_BTN_TEXT = "done" ;
  598. static const String DISMISS_BTN_ERROR_TEXT = "error" ;
  599. // ConfigClient
  600. static const String CONFIG_GUI_ID = "config-gui" ;
  601. static const int CONFIG_SCROLLBAR_W = 12 ;
  602. static const int SUBSCRIPTIONS_X = 24 ;
  603. static const int SUBSCRIPTIONS_Y = 68 ;
  604. static const int SUBSCRIPTIONS_W = 144 ;
  605. static const int SUBSCRIPTIONS_H = 76 ;
  606. // ConfigAudio
  607. static const String JACK_NAME_LABEL_TEXT = "name" ;
  608. static const String ALSA_CONFIG_LABEL_TEXT = "config" ;
  609. // ConfigSubscriptions
  610. static const int SUBSCRIPTION_W = SUBSCRIPTIONS_W - CONFIG_SCROLLBAR_W - PAD2 ;
  611. static const int SUBSCRIPTION_H = 16 ;
  612. // Login
  613. static const String LOGIN_GUI_ID = "login-gui" ;
  614. static const int N_STATIC_LOGIN_CHILDREN = 6 ;
  615. static const int LOGIN_BUTTON_L = GUI::PAD ;
  616. static const int LOGIN_BUTTON_T = GUI::PAD ;
  617. static const int LOGIN_BUTTON_W = 128 ;
  618. static const int LOGIN_BUTTON_H = 24 ;
  619. // License
  620. static const String LICENSE_GUI_ID = "license-gui" ;
  621. // Chat
  622. static const String CHAT_GUI_ID = "chat-gui" ;
  623. static const String SERVER_NICK = "NINJAM" ;
  624. static const String TOPIC_TEXT = "Topic is: " ;
  625. static const String SET_TOPIC_TEXT = " sets topic to: " ;
  626. static const String PM_TEXT = " (whispers)" ;
  627. static const String JOINPART_TEXTa = " has " ;
  628. static const String JOIN_TEXT = "joined" ;
  629. static const String PART_TEXT = "left" ;
  630. static const String JOINPART_TEXTb = " the jam" ;
  631. static const String UNKNOWN_COMMAND_MSG = "Error: unknown command" ;
  632. static const String INVALID_PM_MSG = "Error: /msg requires a username and a message" ;
  633. static const int TOPIC_H = 16 ;
  634. static const int TOPIC_PADDED_H = TOPIC_H + PAD2 ;
  635. static const int MIN_SHOW_TOPIC_CHAT_H = 200 ;
  636. // Channel
  637. static const Identifier MASTER_GUI_ID = CONFIG::MASTER_ID ;
  638. static const Identifier METRO_GUI_ID = CONFIG::METRO_ID ;
  639. static const String XMIT_LABEL_TEXT = "XMIT" ;
  640. static const String RCV_LABEL_TEXT = "RCV" ;
  641. static const CharPointer_UTF8 INFINITY_CHAR = CharPointer_UTF8("\xe2\x88\x9e") ;
  642. static const int N_STATIC_CHANNELS_CHILDREN = 4 ;
  643. static const int CHANNEL_LABEL_H = 12 ;
  644. static const int CHANNEL_Y = CHANNEL_LABEL_H + PAD2 ;
  645. static const int CHANNEL_W = 60 ;
  646. static const int CHANNEL_H = 252 ;
  647. static const int HOVER_BTN_W = 15 ;
  648. static const int HOVER_BTN_H = 16 ;
  649. static const int HOVER_BTN_XC = HOVER_BTN_W / 2 ;
  650. static const int HOVER_BTN_YC = HOVER_BTN_H / 2 ;
  651. // Channels
  652. static const Identifier MASTERS_GUI_ID = CONFIG::MASTERS_ID ;
  653. static const Identifier LOCALS_GUI_ID = CONFIG::LOCALS_ID ;
  654. static const String MASTERS_LABEL_TEXT = "Master" ;
  655. static const String LOCALS_LABEL_TEXT = "Local" ;
  656. static const int CHANNEL_CONFIG_W = 200 ;
  657. static const int CHANNEL_CONFIG_H = 200 ;
  658. static const int MIXERGROUP_Y = PAD ;
  659. static const int MIXERGROUP_H = CHANNEL_H + CHANNEL_LABEL_H + PAD3 ;
  660. static inline int MIXERGROUP_W(int n_channels)
  661. {
  662. return PAD + (n_channels * (CHANNEL_W + PAD)) ;
  663. }
  664. // Mixer
  665. static const String MIXER_GUI_ID = "mixer-gui" ;
  666. static const int MIXER_H = PAD2 + MIXERGROUP_H ;
  667. static const int RESIZER_W = PAD + 2 ;
  668. static const int N_STATIC_MIXER_CHILDREN = 5 ;
  669. static const int LOCALS_IDX = 0 ;
  670. static const int FIRST_REMOTE_IDX = 1 ;
  671. static const int CHANNEL_SCROLL_BTN_H = MIXERGROUP_H / 4 ;
  672. static const int CHANNEL_SCROLL_BTN_W = 24 ;
  673. static const int CHANNEL_SCROLL_BTN_Y = MIXERGROUP_Y +
  674. (MIXERGROUP_H / 2) -
  675. (CHANNEL_SCROLL_BTN_H / 2) ;
  676. // StatusBar
  677. static const String STATUS_GUI_ID = "statusbar-gui" ;
  678. static const String AUDIO_INIT_ERROR_MSG = "audio device error" ;
  679. static const String CONFIG_PENDING_MSG = "press '" + DISMISS_BTN_TEXT + "' to continue" ;
  680. static const String DISCONNECTED_STATUS_TEXT = "Disconnected" ;
  681. static const String ROOM_FULL_STATUS_TEXT = "Jam room full" ;
  682. static const String INVALID_AUTH_STATUS_TEXT = "Invalid login/pass" ;
  683. static const String PENDING_LICENSE_STATUS_TEXT = "Pending license" ;
  684. static const String FAILED_CONNECTION_STATUS_TEXT = "Connection failed" ;
  685. static const String CONNECTING_STATUS_TEXT = "Connecting to " ;
  686. static const String CONNECTED_STATUS_TEXT = "Connected to " ;
  687. static const String IDLE_STATUS_TEXT = "Ready" ;
  688. static const int STATUSBAR_H = 24 ;
  689. static const int STATUS_W = 160 ;
  690. static const int STATUS_H = 16 ;
  691. static const int STATUS_PAD_X = 8 ;
  692. static const int STATUS_PAD_Y = 2 ;
  693. // Loop
  694. static const String LOOP_GUI_ID = "loop-gui" ;
  695. static const int LOOP_X = STATUS_W + PAD3 ;
  696. static const int LOOP_H = STATUS_H ;
  697. static const double BEAT_PROGRESS_OFFSET = CLIENT::GUI_UPDATE_HI_IVL * 0.002 ;
  698. }
  699. #endif // _CONSTANTS_H_