Working Out Where The Music DB Is (PMD & Editor Libraries)

This is where we can share code to do things with our Pacemakers
Post Reply
Sox
Admin Sox
Admin Sox
Posts: 347
Joined: Fri Sep 14, 2012 9:25 pm
Location: Bath, England
Contact:

Working Out Where The Music DB Is (PMD & Editor Libraries)

Post by Sox » Sat Sep 29, 2012 7:11 pm

Pacemaker Device
Assuming your Pacemaker is connected and you have found the Pacemaker drive, then next step will be to determine
  • Where is the music database?
  • Where are the music files (mp3, etc.) stored?
Assuming your Pacemaker drive is K: like mine, then the music database file will be
K:\.Pacemaker\Music.DB

And the music files are stored in various folders under this folder
K:\.Pacemaker\Music

On the Pacemaker, all the music folders and music files use hexadecimal filenames, which doesn't help you to determine which track is which. If you know the track in the database, then the Tracks.Location field will tell you which hex named music file is this track. and where it is in relation to K:\.Pacemaker\Music

Here's an example of getting foldernames in vb .Net

Code: Select all

Private MusicSubFolder As String = "Music"
Private MusicDBSubFolder As String = ".Pacemaker"
Private DatabaseFilename As String = "Music.DB"

'Update some global vars with the info we were looking for    
if FindPacemakerDrive Then
     'Where we find the device's database (library)
     MusicDBFolder = String.Format("{0}{1}", PacemakerDrive, MusicDBSubFolder)
     'The full path to the database file
     MusicDBFilename = String.Format("{0}\{1}", MusicDBFolder, DatabaseFilename)
     'Is it there?
     MusicDBExists = File.Exists(MusicDBFilename)
     'The root of our audio file storage
     MusicFolder = String.Format("{0}{1}\{2}", PacemakerDrive, MusicDBSubFolder, MusicSubFolder)
End If
Never experiment with drugs.... you might waste them

Sox
Admin Sox
Admin Sox
Posts: 347
Joined: Fri Sep 14, 2012 9:25 pm
Location: Bath, England
Contact:

Re: Working Out Where The Music DB Is (PMD & Editor Librarie

Post by Sox » Wed Oct 24, 2012 10:19 pm

Editor Library
First your need to now where the music database is. This is called Music.DB and will be in a Tonium\Pacemaker folder off from your application data folder. This is a hidden folder in your My Documents folder. On my Vista PC for my username "Sox" this is C:\Users\Sox\AppData\Roaming. The the full path to my music DB is
C:\Users\Sox\AppData\Roaming\Tonium\Pacemaker\Music.DB

Here is how to find your editor's DB, and test that it exists in VB .NET

Code: Select all

    Private RoamingToniumSubFolder As String = "\Tonium\Pacemaker"
    Private DatabaseFilename As String = "Music.DB"

    Public MusicDBFolder As String = ""
    Public MusicDBFilename As String = ""
    Public MusicDBExists As Boolean = False
 
    Public Sub New()
        'Determine folder name and DB filepath used by Pacemaker editor
        MusicDBFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & RoamingToniumSubFolder
        'Determine full file path to DB
        If MusicDBFolder <> "" Then
            MusicDBFilename = MusicDBFolder & "\" & DatabaseFilename
            MusicDBExists = File.Exists(MusicDBFilename)
        End If
    End Sub
Never experiment with drugs.... you might waste them

Post Reply