Platforms to show: All Mac Windows Linux Cross-Platform
/MacCocoa/DiscRecording/DataBurn with 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 Events
This example is the version from Sun, 23th Sep 2017.
Project "DataBurn with Events.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Open()
dim track as DRTrackMBS
logwindow.Show
// we need a track
track=CreateTrack
if track<>nil then
bsp=new MyDRBurnSetupPanelMBS
// set a few options
bsp.setCanSelectAppendableMedia true
bsp.setCanSelectTestBurn true
if bsp.runSetupPanel=bsp.NSOKButton then
bpp=new MyDRBurnProgressPanelMBS
// 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
Function CreateTrack() As DRTrackMBS
dim f as FolderItem
dim fo as DRFolderMBS
f=SelectFolder
if f<>nil then
fo=DRFolderMBS.folderWithPath(f)
if fo<>Nil then
Return DRTrackMBS.trackForRootFolder(fo)
end if
end if
End Function
Property bpp As MyDRBurnProgressPanelMBS
Property bsp As MyDRBurnSetupPanelMBS
End Class
Class logwindow Inherits Window
Control list Inherits Listbox
ControlInstance list Inherits Listbox
End Control
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 MyDRBurnSetupPanelMBS Inherits DRBurnSetupPanelMBS
EventHandler Function DeviceContainsSuitableMedia(device as DRDeviceMBS, byref prompt as string) As boolean
System.DebugLog "DeviceContainsSuitableMedia in Xojo"
logwindow.list.addrow "DeviceContainsSuitableMedia: "+device.displayName
app.YieldToNextThread
// allow device
Return true
End EventHandler
EventHandler Function DeviceCouldBeTarget(device as DRDeviceMBS) As boolean
System.DebugLog "DeviceCouldBeTarget in Xojo"
logwindow.list.addrow "DeviceCouldBeTarget: "+device.displayName
app.YieldToNextThread
// allow device
Return true
End EventHandler
EventHandler Sub DeviceSelectionChanged(device as DRDeviceMBS)
System.DebugLog "DeviceSelectionChanged in Xojo"
if device=nil then
logwindow.list.addrow "DeviceSelectionChanged: nil"
else
logwindow.list.addrow "DeviceSelectionChanged: "+device.displayName
end if
app.YieldToNextThread
End EventHandler
EventHandler Function SetupPanelShouldHandleMediaReservations() As boolean
System.DebugLog "SetupPanelShouldHandleMediaReservation in Xojo"
logwindow.list.addrow "SetupPanelShouldHandleMediaReservation"
app.YieldToNextThread
// let the panel do it's job
Return true
End EventHandler
End Class
Class MyDRBurnProgressPanelMBS Inherits DRBurnProgressPanelMBS
EventHandler Function burnProgressPanelBurnDidFinish(burn as DRBurnMBS) As boolean
System.DebugLog "burnProgressPanelBurnDidFinish in Xojo"
logwindow.list.addrow "burnProgressPanelBurnDidFinish Event"
app.YieldToNextThread
End EventHandler
EventHandler Sub burnProgressPanelDidFinish()
System.DebugLog "burnProgressPanelDidFinish in Xojo"
logwindow.list.addrow "burnProgressPanelDidFinish Event"
app.YieldToNextThread
End EventHandler
EventHandler Sub burnProgressPanelWillBegin()
System.DebugLog "burnProgressPanelBurnWillBegin in Xojo"
logwindow.list.addrow "burnProgressPanelBurnWillBegin Event"
app.YieldToNextThread
End EventHandler
End Class
End Project
See also:
- /MacCocoa/DiscRecording/DataBurn
- /MacCocoa/DiscRecording/DataBurn Image
- /MacCocoa/DiscRecording/DataBurn UDF
- /MacCocoa/DiscRecording/DataBurn with Events and Notification
- /MacCocoa/DiscRecording/DataBurn with File Events
- /MacCocoa/DiscRecording/DataBurn with links
- /MacCocoa/DiscRecording/DataBurn with Track Events
- /MacCocoa/DiscRecording/DataBurn with Track Events with ISRC and MCN
The items on this page are in the following plugins: MBS MacCocoa Plugin.