mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

369 lines
12 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/clifford/tse3/gcc3_fixes.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. #
  18. # --- ROCK-COPYRIGHT-NOTE-END ---
  19. --- ./src/tse3/test.cpp.orig Wed May 15 15:56:01 2002
  20. +++ ./src/tse3/test.cpp Wed May 15 16:00:47 2002
  21. @@ -31,6 +31,7 @@
  22. //#include "TSE3Commands/SongCommands.h"
  23. #include <fstream>
  24. +#include <iostream>
  25. using namespace TSE3;
  26. @@ -42,17 +43,17 @@
  27. int main()
  28. {
  29. - cout << "Started...\n\n";
  30. + std::cout << "Started...\n\n";
  31. /*
  32. // This will prove that my representation of MidiCommands is equivalent to
  33. // the old TSE2 word typedef.
  34. MidiCommand com1(MidiCommand_NoteOn, 0, 0, 0x40, 100);
  35. - cout << "command is " << *((int*)&com1) << "\n\n";
  36. + std::cout << "command is " << *((int*)&com1) << "\n\n";
  37. // Proves I can actually create these objects ;-)
  38. MidiScheduler s;
  39. Track t;
  40. - cout << "Created a PhraseEdit and everything else\n";
  41. + std::cout << "Created a PhraseEdit and everything else\n";
  42. // This will prove the Notifier framework.
  43. t.params.setMute(false);
  44. @@ -68,13 +69,13 @@
  45. do
  46. {
  47. MidiEvent e = t.params.event();
  48. - cout << "Event is " << e.event.data.status << "," << e.event.data.data1
  49. + std::cout << "Event is " << e.event.data.status << "," << e.event.data.data1
  50. << "," << e.event.data.data2<< " (" << *((int*)&(e.event.data))
  51. << ")\n";
  52. } while (t.params.consume());
  53. // Try out flag tracks
  54. - cout << "\nCreating FlagTrack\n";
  55. + std::cout << "\nCreating FlagTrack\n";
  56. FlagTrack f;
  57. f.insert(Event<Flag>(Flag("Time 1"), 0));
  58. f.insert(Event<Flag>(Flag("Time 2"), Clock::PPQN));
  59. @@ -84,26 +85,26 @@
  60. f.erase(Event<Flag>(Flag("Time X"), Clock::PPQN*3));
  61. for (int i = 0; i < f.size(); ++i)
  62. {
  63. - cout << " " << i << ": " << f[i].time << " - " << f[i].data.title << "\n";
  64. + std::cout << " " << i << ": " << f[i].time << " - " << f[i].data.title << "\n";
  65. }
  66. int pos = f.index(Clock::PPQN*2.5);
  67. - cout << "\nIndex at " << Clock::PPQN*2.5 << " is " << pos << "\n\n";
  68. + std::cout << "\nIndex at " << Clock::PPQN*2.5 << " is " << pos << "\n\n";
  69. // Test the TempoTrack
  70. TempoTrack tt;
  71. tt.insert(Event<Tempo>(100, 0));
  72. tt.insert(Event<Tempo>(120, 2*Clock::PPQN));
  73. - cout << "Playing TempoTrack...\n";
  74. + std::cout << "Playing TempoTrack...\n";
  75. play(&tt);
  76. */
  77. // Test utilities
  78. /*
  79. string str;
  80. NoteNumberConversion::numberToNote(60,str);
  81. - cout << "Note string is: '" << str << "'\n";
  82. + std::cout << "Note string is: '" << str << "'\n";
  83. int note = NoteNumberConversion::noteToNumber("C#-6");
  84. - cout << "Note number is: " << note << "\n\n\n";
  85. + std::cout << "Note number is: " << note << "\n\n\n";
  86. */
  87. // Test the PhraseEdit
  88. @@ -117,9 +118,9 @@
  89. Clock::PPQN*2));
  90. pe.insert(MidiEvent(MidiCommand(MidiCommand_ProgramChange, 0, 0, 40),
  91. Clock::PPQN*3));
  92. - cout << "Phrase edit size is " << pe.size() << "\n";
  93. + std::cout << "Phrase edit size is " << pe.size() << "\n";
  94. Phrase *phr = pe.createPhrase();
  95. - cout << "New Phrase size is " << phr->size() << "\n\n";
  96. + std::cout << "New Phrase size is " << phr->size() << "\n\n";
  97. */
  98. /*
  99. @@ -132,7 +133,7 @@
  100. part.setRepeat(Clock::PPQN*4);
  101. part.setStart(0);
  102. part.setEnd(Clock::PPQN*8);
  103. - //cout << "\n\nPlaying Part...\n";
  104. + //std::cout << "\n\nPlaying Part...\n";
  105. //play(&part);
  106. Track track;
  107. @@ -141,12 +142,12 @@
  108. */
  109. Song song;
  110. - cout << "No Tracks in the song is: " << song.size() << "\n";
  111. + std::cout << "No Tracks in the song is: " << song.size() << "\n";
  112. /*
  113. song.track(0)->insert(0, Clock::PPQN*4)->setPhrase(phr);
  114. song.track(0)->insert(Clock::PPQN*12, Clock::PPQN*14)->setPhrase(phr);
  115. song.track(0)->insert(Clock::PPQN*8, Clock::PPQN*9)->setPhrase(phr);
  116. - cout << song.track(0)->size() << "\n\n";
  117. + std::cout << song.track(0)->size() << "\n\n";
  118. play(song.track(0));
  119. @@ -159,7 +160,7 @@
  120. /*
  121. FileOperations_2 fo2;
  122. fo2.load(&song, "song.tsemdl");
  123. - cout << "No of tracks in the song is " << song.size() << ". Marvelous.\n\n";
  124. + std::cout << "No of tracks in the song is " << song.size() << ". Marvelous.\n\n";
  125. //play((*(song.track(0)))[0]);
  126. //play(song.track(0));
  127. //play(&song);
  128. @@ -168,16 +169,16 @@
  129. /*
  130. // Load a MIDI file
  131. - cout << "Importing test.mid...\n";
  132. + std::cout << "Importing test.mid...\n";
  133. Song *newSong;
  134. try
  135. {
  136. - MidiFileImport import("test.mid", 2, cout);
  137. + MidiFileImport import("test.mid", 2, std::cout);
  138. newSong = import.import();
  139. }
  140. catch (MidiFileImportError &e)
  141. {
  142. - cout << "Exception thrown: " << *e;
  143. + std::cout << "Exception thrown: " << *e;
  144. }
  145. */
  146. @@ -187,30 +188,30 @@
  147. Phrase *p = pe.createPhrase();
  148. p->setTitle(song.phraseList.newPhraseTitle(PhraseList_NewPhraseString));
  149. song.phraseList.insert(p);
  150. - cout << "New Phrasename: " << p->title();
  151. + std::cout << "New Phrasename: " << p->title();
  152. p = pe.createPhrase();
  153. p->setTitle(song.phraseList.newPhraseTitle(PhraseList_NewPhraseString));
  154. song.phraseList.insert(p);
  155. - cout << "New Phrasename: " << p->title();
  156. + std::cout << "New Phrasename: " << p->title();
  157. */
  158. - //cout << (bool)(*(song.track(0)))[0]->filter.status() << "\n";
  159. + //std::cout << (bool)(*(song.track(0)))[0]->filter.status() << "\n";
  160. // Test the scheduler/transport bobbins
  161. /* Metronome metronome;
  162. MidiSchedulerFactory msf;
  163. MidiScheduler *scheduler = msf.createScheduler();
  164. Transport transport(&metronome, scheduler);
  165. - cout << "Scheduler type is '" << scheduler->implementationName() << "'\n";
  166. + std::cout << "Scheduler type is '" << scheduler->implementationName() << "'\n";
  167. // Test playing
  168. - cout << "Playing the song through the Transport system...\n";
  169. + std::cout << "Playing the song through the Transport system...\n";
  170. transport.play(&song, 0);
  171. while (transport.status() != Transport::resting) transport.poll();
  172. */
  173. // Testing saving
  174. /*
  175. - cout << "Saving Song in TSE3MDL format...\n";
  176. + std::cout << "Saving Song in TSE3MDL format...\n";
  177. TSE3MDL_File file(&song);
  178. ofstream o("song.tse3mdl");
  179. file.save(o, 0);
  180. @@ -219,21 +220,21 @@
  181. // Testing loading
  182. /*
  183. - cout << "Loading file in TSE3MDL format...\n";
  184. + std::cout << "Loading file in TSE3MDL format...\n";
  185. TSE3MDL loader;
  186. Song *newSong
  187. = loader.load("/export/pgoodlif/work/TSE3/tse3/misc/Demo.tse3");
  188. - cout << newSong->title() << endl;
  189. - cout << "No Tracks in the song is: " << song.size() << "\n";
  190. + std::cout << newSong->title() << endl;
  191. + std::cout << "No Tracks in the song is: " << song.size() << "\n";
  192. - cout << "Writing in the XML stylee...\n";
  193. + std::cout << "Writing in the XML stylee...\n";
  194. {
  195. std::ofstream out("out.xml");
  196. TSE3::File::XmlFileWriter writer(out);
  197. TSE3::File::writeSong(writer, *newSong);
  198. }
  199. */
  200. - cout << "Loading file in XML format...\n";
  201. + std::cout << "Loading file in XML format...\n";
  202. std::ifstream in("out.xml");
  203. TSE3::File::XmlFileReader reader(in);
  204. Song *newSong = reader.load();
  205. @@ -244,21 +245,21 @@
  206. /*
  207. CommandHistory history;
  208. Song_SetTitle s(newSong, "This is a new Song title");
  209. - cout << "Song title is " << newSong->title() << endl;
  210. + std::cout << "Song title is " << newSong->title() << endl;
  211. s.execute();
  212. - cout << "Song title is " << newSong->title() << endl;
  213. + std::cout << "Song title is " << newSong->title() << endl;
  214. history.add(&s);
  215. history.undo();
  216. - cout << "Song title is " << newSong->title() << endl;
  217. + std::cout << "Song title is " << newSong->title() << endl;
  218. history.redo();
  219. - cout << "Song title is " << newSong->title() << endl;
  220. + std::cout << "Song title is " << newSong->title() << endl;
  221. */
  222. // Testing playing a Panic object
  223. /*
  224. Panic panic;
  225. panic.setAllNotesOff(true);
  226. - cout << "Playing a Panic object...\n";
  227. + std::cout << "Playing a Panic object...\n";
  228. transport.play(&panic, 0);
  229. while (transport.status() != Transport::resting) transport.poll();
  230. */
  231. @@ -267,18 +268,18 @@
  232. //FileRecogniser fr("song.tse3mdl");
  233. /*
  234. FileRecogniser fr("test.mid");
  235. - cout << "File format is " << fr.type() << endl;
  236. + std::cout << "File format is " << fr.type() << endl;
  237. */
  238. // Test Cakewalk .ins file import routines
  239. //insTest();
  240. /*
  241. - cout << "-----------------------------------------\n";
  242. + std::cout << "-----------------------------------------\n";
  243. Track *track = newSong->track(0);
  244. //play((*track)[0]);
  245. play(newSong);
  246. - cout << "-----------------------------------------\n";
  247. + std::cout << "-----------------------------------------\n";
  248. */
  249. /*
  250. @@ -289,7 +290,7 @@
  251. o.close();
  252. */
  253. - cout << "\n\nFinishing...\n";
  254. + std::cout << "\n\nFinishing...\n";
  255. return 0;
  256. @@ -304,21 +305,21 @@
  257. void play(Playable *p)
  258. {
  259. - cout << "Creating iterator:\n";
  260. + std::cout << "Creating iterator:\n";
  261. PlayableIterator *i = p->iterator(0);
  262. - cout << "Playing a playable:\n";
  263. + std::cout << "Playing a playable:\n";
  264. while (i->more())
  265. {
  266. MidiEvent e = *(*i);
  267. if (e.event.data.status)
  268. - cout << " MidiEvent: " << e.event.time
  269. + std::cout << " MidiEvent: " << e.event.time
  270. << " - " << e.event.data.status << ":"
  271. << e.event.data.data1
  272. << ":" << e.event.data.data2 << "\n";
  273. ++(*i);
  274. }
  275. - cout << "End of playable\n\n";
  276. + std::cout << "End of playable\n\n";
  277. }
  278. @@ -328,45 +329,45 @@
  279. for (int n = 0; n < s->size(); ++n)
  280. {
  281. Track *t = s->track(n);
  282. - cout << "-- ";
  283. + std::cout << "-- ";
  284. for (int m = 0; m < t->size(); ++m)
  285. {
  286. Part *p = (*t)[m];
  287. - cout << "|"<<p->phrase()->title();
  288. - cout << ","<<p->start()<<"-"<<p->end();
  289. - cout <<"| ";
  290. + std::cout << "|"<<p->phrase()->title();
  291. + std::cout << ","<<p->start()<<"-"<<p->end();
  292. + std::cout <<"| ";
  293. }
  294. - cout << "\n";
  295. + std::cout << "\n";
  296. }
  297. }
  298. /*
  299. void insTest()
  300. {
  301. - cout << ">> insTest\n";
  302. + std::cout << ">> insTest\n";
  303. CakewalkInstrumentFile cif("Yamaha.ins");
  304. - cout << "Created the ins file object.\n";
  305. + std::cout << "Created the ins file object.\n";
  306. - cout << "Instruments in this file are (" << cif.instruments().size() << "):\n";
  307. + std::cout << "Instruments in this file are (" << cif.instruments().size() << "):\n";
  308. list<string>::const_iterator i = cif.instruments().begin();
  309. int n = 0;
  310. while (i != cif.instruments().end())
  311. {
  312. - cout << n << " " << *i << endl ;
  313. + std::cout << n << " " << *i << endl ;
  314. ++n;
  315. ++i;
  316. }
  317. - cout << "\nTrying to create an instrument...\n";
  318. + std::cout << "\nTrying to create an instrument...\n";
  319. Instrument *ins = cif.instrument("Yamaha SY-35");
  320. - cout << "\nTrying to write an instrument...\n";
  321. + std::cout << "\nTrying to write an instrument...\n";
  322. ofstream outfile("out.ins");
  323. ins->write(outfile);
  324. outfile.close();
  325. - cout << "<< insTest\n";
  326. + std::cout << "<< insTest\n";
  327. }
  328. */
  329. #endif