Skip to content

Commit

Permalink
fix bad math
Browse files Browse the repository at this point in the history
  • Loading branch information
jcm93 committed Aug 30, 2017
1 parent 5bb21f5 commit 508e646
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ class MainWindowController: NSWindowController, NSSearchFieldDelegate, NSWindowD
if self.delegate?.audioModule.isSeeking != true {
if let nodeTime = delegate?.audioModule.curPlayerNode.lastRenderTime, let playerTime = delegate?.audioModule.curPlayerNode.playerTime(forNodeTime: nodeTime), let duration = self.duration, duration != 0 {
let offset: Double = delegate?.audioModule.track_frame_offset ?? 0
let seconds = (Double(playerTime.sampleTime) + offset) / (playerTime.sampleRate - delegate.audioModule.total_offset_seconds)
let seconds = (Double(playerTime.sampleTime) + offset) / (playerTime.sampleRate) - delegate.audioModule.total_offset_seconds
if let seconds_string = getTimeAsString(seconds) {
currentTimeLabel.stringValue = seconds_string
print(seconds_string)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,13 @@ class DragAndDropArrayController: NSArrayController, NSTableViewDataSource, NSTa
func tableView(_ tableView: NSTableView, writeRowsWith rowIndexes: IndexSet, to pboard: NSPasteboard) -> Bool {
print("table view writerows called")
let rows = NSMutableArray()
var filenames = [String]()
for index in rowIndexes {
let trackView = (self.arrangedObjects as! [TrackView])[index]
rows.add(trackView.track!.objectID.uriRepresentation())
filenames.append(URL(string: trackView.track!.location!)!.path)
}
pboard.setPropertyList(filenames, forType: NSFilenamesPboardType)
draggedRowIndexes = rowIndexes
let encodedIDs = NSKeyedArchiver.archivedData(withRootObject: rows)
let context = mainWindow?.currentSourceListItem?.name
Expand Down

0 comments on commit 508e646

Please sign in to comment.