B4i Library il_AudioPlayer

il_AudioPlayer - View

I would like to share with you CustonView i have created for my new B4i App. It is an AudioPlayer with a nice UI and lot of functions
like playing Songs in background, Playlist, FileDialog and much more. It is still in the testing phase but i think it is already ready for use in real applications.
The player is also very customizable since you have all layouts and icons included and you can enter them and edit them if you
like (dont remove any views or add new views just edit colors if you want).


Installation instructions:

- Copy the *.a and *.h files into the folder "Libs" in your MAC or in your MAC HOSTED by AnywhereSoftware, normally in "B4i-MacServer\Libs" folder

- Copy the il_AudioPlayer.xml to your custom libraries folder in B4i

- Unzip Files.zip and copy all files to your ../Files Folder (it includes icons, layouts, etc...). The Example.zip includes already all necessary files.

- Select lib in Libraries Manager






il_AudioPlayer

Author: Ilan Tetruashvili
Version: 0.03


Methods:

  • IsInitialized As BOOL
    Tests whether the object has been initialized.
  • _ap_changethememode: (mode As int) As NSString*
    Change the Thememode (0 = lightmode, 1 = darkmode)
  • _ap_createsong:::::::: (trackId As int, dir As NSString*, filename As NSString*, title As NSString*, favorite As BOOL, trackimgHD As B4IBitmap*, trackimgSD As B4IBitmap*, videoUrl As NSString*) As _song*
    trackid (A uniqe id [int]) dir (Track directory path) filename (Track filename) title (Set the Title that will be shown in Player) favorite (Set if favorite Boolean) trackimgHD (Set bitmap that will show in Player HD) trackimgSD (Set bitmap that will show in Song list for this track SD) videoUrl (Set the video URL to open it on button click. If is emptry, Youtube will be opened with Title string and search for the track video)
  • _ap_pause As NSString*
    Pause the Player
  • _ap_playlistpath: (path As NSString*) As NSString*
    Set the Playlistpath where all playlists will be saved and loaded from
  • _ap_playnexttrack As NSString*
    Play next Track
  • _ap_playprevioustrack As NSString*
    Play previous Track
  • _ap_playtrack: (pos As int) As NSString*
    Play Track with selected index
  • _ap_returnbasepanel As B4IPanelWrapper*
    Return Base Panel as Panel
  • _ap_returncurrenttrackindex As int
    Return current Track index that is playing
  • _ap_returnspecialbuttonspanel As B4IPanelWrapper*
    Return Special controls Panel as Panel
  • _ap_returntitlelabel As B4ILabelWrapper*
    Return Title Label as Label
  • _ap_setloopplay: (value As BOOL) As NSString*
    If true the list will continue playing when finished
  • _ap_setskipseconds: (value As int) As NSString*
    Set the skip seconds. clicking the skip buttons will forward or backward the track for x seconds
  • _ap_show As NSString*
    Show Player with animation from bottom to top
  • _ap_showspecialbuttons: (value As BOOL) As NSString*
    Show/hide special controls on bottom of the screen
  • _ap_songlist As B4IList*
    Return full songlist (holds type objects)
  • _ap_recreatetracklist:
    Recreates the Tracklist again if it is missing
  • _ap_recreatePlaylist:
    Recreates the Playlist again if it is missing
  • _ap_songpath: (path As NSString*) As NSString*
    Set the Songpath that will be the startpath in the FileDialog
  • _ap_songpathlongclick: (path As NSString*) As NSString*
    Set a second Songpath that will be the startpath in the FileDialog (will be raised on longclick)
  • _class_globals As NSString*
  • _initialize:::::::: (ba As B4I*, myApp As B4IApplicationWrapper*, CallBack As NSObject*, CallPanel As B4IPanelWrapper*, Event As NSString*, ThemeMode As int, BackgroundPlay As BOOL, ShowScreenControls As BOOL) As NSString*
    myApp (App As Application) CallBack (Sender page) CallPanel (Panel that will hold the player like Page.Rootpanel) Event (Object Event to handle CallSub() Method) ThemeMode (0 = Lightmode, 1 = Darkmode) BackgroundPlay (Allow player to play in background) ShowScreenControls (Show extra controls on bottom)


Song (Type Object)
  • Fields:
    • IsInitialized As BOOL
      Tests whether the object has been initialized.
    • trackId As int
    • dir As NSString*
    • filename As NSString*
    • title As NSString*
    • favorite As BOOL
    • trackimgHD As B4IBitmap*
    • trackimgSD As B4IBitmap*
    • videoUrl As NSString*

  • Methods:
    • Initialize As void
      Initializes the fields to their default value.



Fileatt (Type Object)
  • Fields:
    • IsInitialized As BOOL
      Tests whether the object has been initialized.
    • path As NSString*
    • filename As NSString*
    • isdir As BOOL
    • isselected As BOOL

  • Methods:
    • Initialize As void
      Initializes the fields to their default value.



(Live preview on my new App FileCube)



** License: You can use this lib in any of your Projects. You may not sell or publish the lib files in any other forum
without my permission. If you like the lib please consider a donation since it took me a lot of time to create it
 

Attachments

  • Example.zip
    426.4 KB · Views: 18
  • Files.zip
    315.9 KB · Views: 16
  • Lib v0.3.zip
    427.2 KB · Views: 17
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…