如何在iOS上从蓝牙中寻找一首歌

时间:2015-05-28 11:48:22

标签: ios objective-c bluetooth objective-c-blocks objective-c-runtime

我目前正在开发iPhone应用程序,我需要UISlider来更改我从蓝牙获得的值。接收数据工作得很好,但是当涉及到更改Slider时,没有任何作用。

screenshot

-(IBAction)progressEnd
{
    self.panningProgress = NO;

    if(self.songPlayer)
    {
        CMTime t = CMTimeMake(self.progressSlider.value, 1);
        self.trackCurrentTimer.text = [self stringFromTime:t.value];
        [self.songPlayer seekToTime:t];
    }
    else if([TDAudioPlayer sharedAudioPlayer].state == TDAudioPlayerStatePlaying)
    {
        float t1 = self.progressSlider.value;
        float t2 = [[TDAudioPlayer sharedAudioPlayer] getPlayerTime];

        if(t1<=t2)
        {  
            self.progressSlider.value = t1;
            self.trackCurrentTimer.text = [self stringFromTime:t1];
            [[TDAudioPlayer sharedAudioPlayer] internalSeekToTime:t1];
        }
    }  
}
- (IBAction)progressChanged:(UISlider *)sender
{
    self.panningProgress = YES;
    self.trackCurrentTimer.text = [self stringFromTime:sender.value];
}

0 个答案:

没有答案