我目前正在开发iPhone应用程序,我需要UISlider
来更改我从蓝牙获得的值。接收数据工作得很好,但是当涉及到更改Slider时,没有任何作用。
-(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];
}