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.

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