Platforms to show: All Mac Windows Linux Cross-Platform
/MacCocoa/DiscRecording/DataBurn with Track Events
Required plugins for this example: MBS MacBase Plugin, MBS MacControls Plugin, MBS Main Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCocoa/DiscRecording/DataBurn with Track Events
This example is the version from Sun, 17th Mar 2012.
Project "DataBurn with Track Events.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Open()
dim track as DRTrackMBS
dim bsp as DRBurnSetupPanelMBS
dim bpp as DRBurnProgressPanelMBS
// we need a track
track=new MyDrTrack
if track<>nil then
bsp=new DRBurnSetupPanelMBS
// set a few options
bsp.setCanSelectAppendableMedia true
bsp.setCanSelectTestBurn true
if bsp.runSetupPanel=bsp.NSOKButton then
bpp=new DRBurnProgressPanelMBS
// And start off the burn itself. This will put up the progress dialog
// and do all the nice pretty things that a happy app does.
bpp.beginProgressPanelForBurn bsp.burnObject, track
else
MsgBox "You pressed cancel."
end if
end if
End EventHandler
End Class
Class Window1 Inherits Window
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
Class MyDrTrack Inherits DRTrackMBS
EventHandler Sub cleanupTrackAfterBurn()
System.DebugLog "cleanupTrackAfterBurn"
End EventHandler
EventHandler Function prepareTrack(burn as DRBurnMBS) As boolean
System.DebugLog "prepareTrack"
Return true // success
End EventHandler
EventHandler Function produceDataForTrack(buffer as memoryblock, Bufferlen as uint32, address as uint64, blocksize as uint32, byref flags as uint32) As uint32
const SampleRate=48000.0
const fL=440.0 // C
const fR=440.0
dim offset as integer
dim l,r as integer
system.DebugLog "produceDataForTrack"
buffer.LittleEndian=true
while offset<Bufferlen
l= 32767.0 * 0.25 * sin((timeIndex) * 2.0 * 3.1415926 * fL / SampleRate)
r= 32767.0 * 0.25 * sin((timeIndex) * 2.0 * 3.1415926 * fR / SampleRate)
timeIndex=timeIndex+1
buffer.Short(offset)=l
offset=offset+2
buffer.Short(offset)=r
offset=offset+2
wend
System.DebugLog str(offset)+" of "+stR(Bufferlen)+" bytes produced"
Return offset
End EventHandler
Sub Constructor()
// Calling the overridden superclass constructor.
Super.Constructor
me.length=new DRMSFMBS(10000)
me.BlockSize=2352
me.DataForm=0
me.SessionFormat=0
me.TrackMode=0
me.BlockType=0
End Sub
Property Protected timeIndex As integer
End Class
End Project
See also:
- /MacCocoa/DiscRecording/DataBurn
- /MacCocoa/DiscRecording/DataBurn Image
- /MacCocoa/DiscRecording/DataBurn UDF
- /MacCocoa/DiscRecording/DataBurn with Events
- /MacCocoa/DiscRecording/DataBurn with Events and Notification
- /MacCocoa/DiscRecording/DataBurn with File Events
- /MacCocoa/DiscRecording/DataBurn with links
- /MacCocoa/DiscRecording/DataBurn with Track Events with ISRC and MCN
The items on this page are in the following plugins: MBS MacCocoa Plugin.