@@ -0,0 +1,26 @@
+#include <vector>
+
+class Sequencer
+{
+ std::vector<Loop> loops;
+ unsigned int currentLoopIndex;
+public:
+ Sequencer();
+ void run();
+};
+Sequencer::Sequencer()
+ : loops(1), currentLoopIndex(0)
+}
+void Sequencer::run()
+ loops[0].start();
+ while(true) {
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
+ }
@@ -1,19 +1,12 @@
#include <iostream>
#include <Loop.h>
-#include "sleep.h"
+#include <Sequencer.h>
+Sequencer sequencer;
int main()
{
- Loop loop;
-
- loop.bars.push_back(Bar());
- loop.start();
- loop.setBpm(100);
- std::this_thread::sleep_for(std::chrono::milliseconds(2000));
- loop.setBpm(160);
- std::this_thread::sleep_for(std::chrono::milliseconds(7000));
+ sequencer.run();
return 0;
}
@@ -1,14 +0,0 @@
-#ifndef sleep_h
-#define sleep_h
-// Platform-dependent sleep routines.
-#if defined(__WINDOWS_MM__)
- #include <windows.h>
- #define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds )
-#else // Unix variants
- #include <unistd.h>
- #define SLEEP( milliseconds ) usleep( (unsigned long) (milliseconds * 1000.0) )
-#endif