diff options
author | Timothy Pearson <[email protected]> | 2013-01-26 13:17:21 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2013-01-26 13:17:21 -0600 |
commit | dfe289850f068f19ba4a83ab4e7e22a7e09c13c9 (patch) | |
tree | c297348a55df66c571de4525646e0b9762427353 /libtdemid/tests/ctest.c | |
parent | b7658a0d5eca24a9d37c6e04f88298ef02389db0 (diff) | |
download | tdelibs-dfe289850f068f19ba4a83ab4e7e22a7e09c13c9.tar.gz tdelibs-dfe289850f068f19ba4a83ab4e7e22a7e09c13c9.zip |
Rename a number of libraries and executables to avoid conflicts with KDE4
Diffstat (limited to 'libtdemid/tests/ctest.c')
-rw-r--r-- | libtdemid/tests/ctest.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/libtdemid/tests/ctest.c b/libtdemid/tests/ctest.c new file mode 100644 index 000000000..0e7d25884 --- /dev/null +++ b/libtdemid/tests/ctest.c @@ -0,0 +1,54 @@ +#include <libtdemid/libtdemid.h> +#include <unistd.h> +#include <stdio.h> + +int main (int argc, char **argv) +{ + int i; + char c; + + printf("Test1 %s. Using libtdemid from a simple C application\n",kMidVersion()); + printf("%s\n",kMidCopyright()); + + if (kMidInit()!=0) + { + printf("Error initializing libtdemid\n"); + return 0; + } + + if (kMidDevices()!=0) + { + printf("Available devices :\n"); + for (i=0;i<kMidDevices();i++) + { + printf(" %d) %s - %s\n",i,kMidName(i),kMidType(i)); + } + printf("\nSelect one:"); + c=getc(stdin); + } + else + { + printf("There's no available devices. Let's pretend we didn't noticed it\n"); + printf("and start playing.\n"); + c='0'; + } + + kMidSetDevice((int)(c-'0')); + + kMidLoad("Kathzy.mid"); + kMidPlay(); + + for (i=0;i<45;i++) + { + printf("%d/45 seconds\n",i+1); + sleep(1); + } + + kMidStop(); + kMidDestruct(); + + + return 0; + +}; + |