diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | ce4a32fe52ef09d8f5ff1dd22c001110902b60a2 (patch) | |
tree | 5ac38a06f3dde268dc7927dc155896926aaf7012 /libkmid/tests/ctest.c | |
download | tdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.tar.gz tdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkmid/tests/ctest.c')
-rw-r--r-- | libkmid/tests/ctest.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/libkmid/tests/ctest.c b/libkmid/tests/ctest.c new file mode 100644 index 000000000..6e427a2c7 --- /dev/null +++ b/libkmid/tests/ctest.c @@ -0,0 +1,54 @@ +#include <libkmid/libkmid.h> +#include <unistd.h> +#include <stdio.h> + +int main (int argc, char **argv) +{ + int i; + char c; + + printf("Test1 %s. Using libkmid from a simple C application\n",kMidVersion()); + printf("%s\n",kMidCopyright()); + + if (kMidInit()!=0) + { + printf("Error initializing libkmid\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; + +}; + |