Repository navigation
Add the app icon and browser drag and drop for samples and instruments - #78
Merged
Merged
Conversation
- App icon: rendered from docs/art/icon by tools/art/make-icons.mjs into crates/dstudio-app/icons; Device.app carries device.icns, device-studio.exe and the installer device.ico, the Linux package and window device-256.png. - A sample dragged from the browser onto the Devices panel loads into the selected track's Sampler or Pad Sampler. - An instrument dropped below the tracks, or double-clicked with no instrument track selected, gets a new instrument track named after it (one undo step). - Self-test: real pointer drags for each drop, and the double-click.
Browser file drops measured the beat from the Timeline panel's left edge instead of the lanes, so a dropped clip landed a track-header width to the right of the pointer. Drops now use the lane origin and the arrangement's snap grid, and while dragging over the lanes a clip preview (the file's length, in the colour of the track that gets it) shows where it lands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Chris · project thread
What
App icon. The mark (one sine cycle, white on the app's blue tile) becomes the app icon everywhere:
docs/art/icon/app-icon-macos.svg(macOS grid: 824 pt tile with a soft shadow on a 1024 pt canvas) anddocs/art/icon/app-icon.svg(Windows and Linux) are the sources;node tools/art/make-icons.mjsrenders them intocrates/dstudio-app/icons/(device.icns,device.ico,device-256.png,device-macos-512.png).tools/macos-bundle.shputsdevice.icnsinDevice.app(CFBundleIconFile). Run outside the bundle (cargo run), the Dock gets the icon at start-up (appmenu::set_dock_icon).build.rsbuildsdevice.icointodevice-studio.exe(embed-resource, Windows hosts only); the installer uses it asSetupIconFile.share/icons/hicolor/256x256/apps/device-studio.pngand the desktop entry names it; the window usesdevice-256.pngas its title bar and taskbar icon.Samples dragged onto the arrangement land where you drop them, with a preview.
Layout::lanes_x) and the arrangement's snap grid (when snap is on).Samples onto a sampler; instruments.
Screenshots
App icon (macOS 512 px with its shadow; Windows/Linux 256, 64, 32 and 16 px). Before: no icon (generic app icon in the Dock, Explorer and the Linux launcher).
Drop preview, after: dragging
kick.wavover the first audio track at bar 3 (the clip starts under the pointer, snapped to the grid). Before: the whole track was outlined, with no position shown, and the clip landed 191 pt to the right.Below the tracks: the preview in the new track's colour.
Tests
New self-test section
drop:drives each case with real pointer events (8 checks): the preview at beat 8 in the track's colour while the drag is held, the clip landing at exactly beat 8 on release (the regression), a sample below the tracks, a sample onto a Sampler; double-click of Sampler with an audio track selected; Sampler dragged onto an instrument track and below the tracks. Full self-test 698/698 on Linux at the first commit.Benchmarks
No hot path changes: drop targets and the preview are computed on pointer events during a drag only; measuring a file's length decodes it once on a worker thread per file per session.
Docs
Generated by Claude Code