{"id":153,"date":"2018-06-19T23:41:49","date_gmt":"2018-06-19T22:41:49","guid":{"rendered":"http:\/\/blog.petejefferson.co.uk\/?p=153"},"modified":"2018-06-19T23:41:49","modified_gmt":"2018-06-19T22:41:49","slug":"the-dn-2000f-interface-library","status":"publish","type":"post","link":"https:\/\/blog.petejefferson.co.uk\/?p=153","title":{"rendered":"The DN-2000F interface library"},"content":{"rendered":"<h2>The library exposes the following functions:<\/h2>\n<h2><em>Start-up:<\/em><\/h2>\n<p><strong>Init(char *ComPort)<\/strong><br \/>\nConfigures the serial port the RC-35B is connected to.<\/p>\n<p><strong>SetPitchChangeCallback(PitchChangeCallback handler)<\/strong><br \/>\nRegister the callback code for when the pitch changes. This gets called for pitch slider changes and pitch bend.<\/p>\n<p><strong>SetTimeModeCallback(TimeModeCallback handler)<\/strong><br \/>\nRegister the callback code when the TIME button is pressed.<\/p>\n<p><strong>SetPlayPauseCallback(PlayPauseCallback handler)<\/strong><br \/>\nRegister the callback code when the PLAY\/PAUSE button is pressed.<\/p>\n<p><strong>SetCueCallback(CueCallback handler)<\/strong><br \/>\nRegister the callback code when the CUE button is pressed.<\/p>\n<p><strong>SetSearchCallback(SearchCallback handler)<\/strong><br \/>\nRegister the callback code when the SEARCH &lt;&lt; or &gt;&gt; buttons are pressed.<\/p>\n<p><strong>SetScanCallback(SearchCallback handler)<\/strong><br \/>\nRegister the callback code when the SEARCH &lt;&lt; or &gt;&gt; buttons are held down for a period.<\/p>\n<h2><em>Operation:<\/em><\/h2>\n<p><strong>Load(byte Deck, byte DurationMinutes, byte DurationSeconds, byte DurationFrames)<\/strong><br \/>\nSends the track duration to the deck.<\/p>\n<p><strong>UpdateTime(byte Deck, byte Minute, byte Second, byte Frame, bool IsCued, bool IsPaused, bool IsPlaying)<\/strong><br \/>\nUpdates the time display on the deck.<\/p>\n<p><strong>Play(byte Deck)<\/strong><br \/>\nPuts the deck status in play mode.<\/p>\n<p><strong>Pause(byte Deck)<\/strong><br \/>\nPuts the deck status in pause mode.<\/p>\n<p><strong>UpdateTimeMode(byte Deck, byte Mode)<\/strong><br \/>\nChanges the time mode (elapsed or remain) for the deck.<\/p>\n<p><strong>Cue(byte Deck, byte Minute, byte Second, byte Frame)<\/strong><br \/>\nPuts the deck status in to cue mode.<\/p>\n<p>&nbsp;<\/p>\n<h2>The following types are used for the callbacks:<\/h2>\n<p><em><strong>In all cases, Deck refers to the deck number &#8211; either 1 or 2.<\/strong><\/em><\/p>\n<p><strong>void\u00a0PitchChangeCallback(byte Deck, float PitchPercent)<\/strong><br \/>\nPitchPercent is the new pitch value in percent, e.g. 4.2%.<\/p>\n<p><strong>void\u00a0TimeModeCallback(byte Deck, byte TimeMode)<\/strong><br \/>\nTimeMode is the new selected mode either 1 for Elapsed, or 2 for Remain.<\/p>\n<p><strong>void\u00a0PlayPauseCallback(byte Deck)<\/strong><\/p>\n<p><strong>void\u00a0CueCallback(byte Deck)<\/strong><\/p>\n<p><strong>void SearchCallback(byte Deck, byte Direction, byte Speed)<\/strong><br \/>\nDirection is either 1 for forward, or 2 for backward. The speed starts off at 1 and increases the longer the SEARCH button is held. If the SEARCH button is held long enough it switches to Scan.<\/p>\n<p><strong>void ScanCallback(byte Deck, byte Direction, byte Speed)<\/strong><br \/>\nDirection is either 1 for forward, or 2 for backward. The speed starts off at 1 and increases the longer the SEARCH button is held.<\/p>\n<p>&nbsp;<\/p>\n<h2>Typical use:<\/h2>\n<ol>\n<li>Assign <strong>callbacks<\/strong> for the events.<\/li>\n<li>Call the <strong>Init()<\/strong> function passing in the COM port name.<\/li>\n<li>Prepare playback by calling <strong>Load()<\/strong> passing in the track duration.<\/li>\n<li>Operate the RC-35B.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>A full demo using the Un4seen BASS Audio Library can be found on the SourceForge page:\u00a0<a href=\"https:\/\/sourceforge.net\/projects\/denon-dn-interface\">https:\/\/sourceforge.net\/projects\/denon-dn-interface<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The library exposes the following functions: Start-up: Init(char *ComPort) Configures the serial port the RC-35B is connected to. SetPitchChangeCallback(PitchChangeCallback handler) Register the callback code for when the pitch changes. This gets called for pitch slider changes and pitch bend. SetTimeModeCallback(TimeModeCallback handler) Register the callback code when the TIME button is pressed. SetPlayPauseCallback(PlayPauseCallback handler) Register the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-153","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/blog.petejefferson.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.petejefferson.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.petejefferson.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.petejefferson.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.petejefferson.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=153"}],"version-history":[{"count":0,"href":"https:\/\/blog.petejefferson.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/153\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.petejefferson.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.petejefferson.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.petejefferson.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}