Getting Started with FoxBurner SDK (formerly Pixbyte Burning SDK) — Quick Setup & ExamplesFoxBurner SDK (formerly Pixbyte Burning SDK) is a cross-platform library designed to add optical disc burning capabilities to desktop applications. It supports burning CD, DVD, and Blu-ray media, image creation and burning, multilayer discs, UDF/ISO file systems, session handling, and device control. This guide walks through quick setup, core concepts, sample code, and practical tips to integrate FoxBurner SDK into your projects.
What FoxBurner SDK provides (high level)
- Cross-platform disc burning for Windows, macOS, and selected Linux distributions.
- Support for CD/DVD/Blu-ray media and disc image formats (ISO, BIN/CUE, IMG).
- File system control with UDF and ISO9660 support, session management, and multisession disc handling.
- Hardware control including device enumeration, drive locking, eject, and speed control.
- Error reporting and logging with callbacks and progress events for responsive UI updates.
System requirements
- Operating system: Windows 10+, macOS 10.13+, Linux (kernel 4.x+, distro-specific prerequisites).
- Compiler/IDE: Visual Studio 2019+ (Windows), Xcode 11+ (macOS), GCC/Clang with CMake (Linux).
- Runtime: C++ runtime compatible with the SDK build (usually C++17).
- Administrative privileges may be required for low-level device access on some platforms.
Installation & licensing
FoxBurner SDK is commercially licensed; obtain a developer license and download from the vendor. Typical distribution includes:
- Precompiled dynamic libraries (.dll/.dylib/.so) and static archives (.lib/.a).
- Header files and documentation.
- Sample projects for supported platforms.
Basic installation steps:
- Unpack SDK into your project or system-wide SDK folder.
- Add include paths (headers) and link against the appropriate library for your target platform and build configuration.
- Copy runtime libraries next to your executable (if using dynamic linking).
- Add any required entitlements or permissions on macOS and Linux (e.g., access to device files).
Core API concepts
- Device manager / enumerator: enumerates optical drives and queries capabilities.
- Burn session: encapsulates a burn operation (write speed, media type, session type).
- Image handler: create or burn ISO/BIN images.
- File system builder: add files/folders, set UDF/ISO options, finalize or leave sessions open.
- Progress and event callbacks: get status, percent complete, errors, and allow cancellation.
Quick Windows example (C++, synchronous burn)
This example demonstrates enumerating drives, creating a simple UDF filesystem, and burning files to a disc. Replace API names with those from your FoxBurner SDK headers as necessary.
#include <FoxBurner/foxburner.h> #include <iostream> #include <vector> int main() { // Initialize SDK if (!fb::Initialize()) { std::cerr << "Failed to initialize FoxBurner SDK "; return 1; } // Enumerate devices auto devices = fb::DeviceManager::Enumerate(); if (devices.empty()) { std::cerr << "No optical drives found "; fb::Shutdown(); return 1; } auto drive = devices[0]; // use first drive std::cout << "Using drive: " << drive.GetName() << " "; // Prepare burn session fb::BurnSession session(drive); session.SetWriteSpeed(8); // 8x session.SetMediaType(fb::MediaType::DVD); // Build filesystem fb::FileSystemBuilder fs; fs.SetFileSystemType(fb::FileSystemType::UDF); fs.AddFile("README.txt", "This disc was burned with FoxBurner SDK."); fs.AddDirectory("docs"); fs.AddFile("docs/manual.pdf", "/path/to/manual.pdf"); // Attach filesystem to session session.SetFileSystem(fs); // Progress callback session.OnProgress([](const fb::Progress& p){ std::cout << "Progress: " << p.percent << "% "; }); // Start burn auto result = session.Burn(); if (!result.success) { std::cerr << "Burn failed: " << result.errorMessage << " "; } else { std::cout << "Burn completed successfully "; } fb::Shutdown(); return 0; }
Notes:
- Use asynchronous APIs for UI apps to avoid blocking the main thread.
- Check and handle media presence, free space, and multi-session requirements before burning.
Quick macOS example (Swift calling Objective-C wrapper)
If the SDK provides an Objective-C API, you can bridge it into Swift. Below pseudocode shows the flow.
import Foundation import FoxBurnerObjC let manager = FBDeviceManager() guard let drive = manager.enumerateDevices().first else { print("No optical drives found") exit(1) } let session = FBBurnSession(device: drive) session.writeSpeed = 8 session.mediaType = .dvd let builder = FBFileSystemBuilder() builder.fileSystemType = .udf builder.addFile(atPath: "/Users/me/README.txt", as: "README.txt") builder.addDirectory(atPath: "/Users/me/docs", as: "docs") session.fileSystem = builder.createImage() session.onProgress = { progress in print("Progress: (progress.percent)%") } session.start { result in switch result { case .success: print("Burn completed") case .failure(let error): print("Burn failed: (error.localizedDescription)") } }
Example: Creating an ISO image (cross-platform)
Most SDKs expose an image creation API that builds ISO/UDF files without writing to physical media.
fb::ImageCreator creator; creator.SetFileSystemType(fb::FileSystemType::ISO9660); creator.AddFile("/path/to/file.txt", "file.txt"); creator.AddDirectory("/path/to/photos", "photos"); auto out = creator.CreateImage("/tmp/mydisc.iso"); if (!out.success) { std::cerr << "Image creation failed: " << out.errorMessage << " "; } else { std::cout << "ISO created at " << out.path << " "; }
Use cases:
- Pre-build images for testing.
- Distribute ISO files for download.
- Burn image later to multiple discs.
Handling multisession and appendable discs
- To create appendable discs, do not finalize the session. Leave the session open when burning to allow later additions.
- Query drive/media for multisession support before attempting an append.
- When appending, build a new session that references the previous session’s file system as the baseline.
Error handling & common pitfalls
- Media compatibility: not all drives support all disc types or high write speeds reliably. Query drive capabilities.
- Media quality: low-quality blanks can fail at higher speeds—use conservative write speeds if unsure.
- Session finalize vs. close: finalizing makes disc readable in most players; leaving open is necessary for multisession.
- Permissions: on macOS and Linux, raw device access may require administrator privileges or special entitlements.
- Threading: burning is I/O and device intensive—use background threads and provide cancellation hooks.
Progress reporting & UI tips
- Use SDK progress callbacks to update a progress bar. Report overall percent, current track/file, estimated time remaining, and speed.
- Provide cancel/abort controls that call the SDK’s safe abort API—avoid killing the process.
- Log events and device responses to help troubleshoot failed burns.
Testing & validation
- Test with multiple drive models and media brands.
- Verify burned discs on different players/systems to ensure compatibility.
- Use checksum verification features if provided (compare source vs. disc after burn).
Performance considerations
- Use buffered I/O when preparing large file sets to avoid stalls.
- Match write speeds to drive and media capabilities; higher speeds increase the chance of errors.
- When burning multiple discs, consider creating an image once and burning that image repeatedly.
Security considerations
- Validate and sanitize file paths before adding to the image.
- If your application allows user-supplied content, scan for malicious filenames (e.g., path traversal, device path names).
- Be mindful of licensing and copyright when distributing burned content.
Troubleshooting checklist
- No drive detected: ensure SDK initialized, device drivers installed, and the app has permission to access hardware.
- Burn errors mid-way: try lower write speed, different media brand, or update firmware on the drive.
- ISO not bootable: ensure correct boot image options and file system type (El Torito spec for bootable CDs).
- Multisession problems: verify the first session was left open and that the drive supports appendable sessions.
Where to find further documentation
- Refer to the SDK’s shipped documentation for exact class and function names, error codes, and platform-specific notes.
- Use included sample projects as templates for integrating with GUI frameworks (Win32/MFC, .NET, Cocoa, Qt).
Example integration checklist (for your project)
- [ ] Obtain SDK and license.
- [ ] Add include paths and link libraries.
- [ ] Copy runtime libraries to deployment bundle.
- [ ] Request necessary OS permissions.
- [ ] Implement device enumeration and capability checks.
- [ ] Implement image creation and burn workflows with progress/cancellation.
- [ ] Test across drives, media, and OS versions.
FoxBurner SDK (formerly Pixbyte Burning SDK) is a robust solution for adding disc burning and image creation to desktop applications. Use the provided examples and checklist to get a basic integration working, then expand to asynchronous operations, advanced file system options, and production-ready error handling.
Leave a Reply