How to Use - Rado-1/ZgeSL GitHub Wiki

Usage CML in ZGameEditor project

  1. Open an ZGE project.
  2. Include ZExternalLibrary components for ZgeSL, MCI and CML to the OnLoaded section of ZApplication. All can be copied from the demos\player.zgeproj project.
  3. Use the musicInit function to initialize the library. Usually it is placed to the OnLoaded section.
  4. Use the musicExit function to release allocated resources. Usually it is placed to the OnClose section.
  5. Play the music file or URI by musicPlayFile function, stop playing by musicStop) function.
  6. Other functions can be used arbitrary to pause and resume playing (musicPause, musicResume), set volume (musicSetVolume), set panning (musicSetPanning), get duration (musicGetDuration), get playing status (musicGetStatus), get playing position (musicGetPosition), or set playing position (musicSetPosition).

For examples of usage ZgeSL in ZGE projects, download the demo application from here.

Opening files on Android

Use the following file names in the musicPlayFile call:

  • if the <file> is included in the application's assets directory, use "<file>", or
  • if the <file> is placed in a <directory> on SDCARD, use "file://sdcard/<directory>/<file>", or
  • if the file is opened from <uri> Internet address, use "<uri>".

Compiling Windows application

Just use one of the Project Windows building menu items.

Compiling Android application

  1. Compile your Android application, e.g., use Project / Android: Build APK (debug) menu item.
  2. Place libZgeSL.so file to the libs/armeabi folder. If the destination device supports the armv7a instruction set, it is recommended to use the library from armeabi-v7a folder. If not and you want to support wider range of devices, use the library from armeabi folder. They both work fine, but the version for armv7a achieves better performance.
  3. If you want to bundle mp3 file(s) to the built application, place them to the assets directory.
  4. Compile the APK again as in step 1.
  5. Deploy the APK file to your Android device and install it in a standard way.

Note 1: The 1st and 2nd steps are required only when the application is built the first time. After that, a single compilation produces correct APK.

Note 2: Use the step 2 also in the case when updating to a newer version of the ZgeSL library.

⚠️ **GitHub.com Fallback** ⚠️