Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Bass.net BASS_ChannelGetLength

Featured Replies

Posted

I make this function that i get the length of the fasttracker modules but i get no return.

My function looks like this :

        public string Getlength(string nm)
        {
            long len = Bass.BASS_ChannelGetLength(HMUSIC,BASSMode.BASS_POS_BYTES);//gets the length of the mod file as bytes
            double time = Bass.BASS_ChannelBytes2Seconds(HMUSIC, len);//convert mod bytes to seconds            return nm;        }

This is how i call it player.getlength(label2.text);

I hope some one can help my on this,is for are littel player on c#.

I solved it by my self.her is the code if some on has the same prop with bass.net

public string Getlength(string name2)        {            BASSActive status = Bass.BASS_ChannelIsActive(HMUSIC);             if (status == BASSActive.BASS_ACTIVE_PLAYING)            {             long pos = Bass.BASS_ChannelGetPosition(HMUSIC);             long len = Bass.BASS_ChannelGetLength(HMUSIC);             Double totaltime = Bass.BASS_ChannelBytes2Seconds(HMUSIC, len);             Double elapsedtime = Bass.BASS_ChannelBytes2Seconds(HMUSIC, pos);             Double remainingtime = totaltime - elapsedtime;             name2 = String.Format("Elapsed: {0:#0.00} - Total: {1:#0.00} - Remain: {2:#0.00}", Utils.FixTimespan(elapsedtime, "MMSS"), Utils.FixTimespan(totaltime, "MMSS"), Utils.FixTimespan(remainingtime, "MMSS"));            }          return name2.ToString();        }

Edited by accede

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.