Ticket #2179 (closed feature: obsolete)

Opened 15 years ago

Last modified 13 years ago

link-actions-timeline - Play, stop and pause for timelines

Reported by: deyan Owned by: stefan
Priority: critical Milestone: X3
Component: uncategorized Version: 2.0
Keywords: Cc: stefan
Category: unknown Effort: 2
Importance: 91 Ticket_group:
Estimated Number of Hours: 0 Add Hours to Ticket: 0
Billable?: yes Total Hours: 0
Analysis_owners: deyan Design_owners: stefan
Imp._owners: stefan Test_owners:
Analysis_reviewers: Changelog:
Design_reviewers: pap Imp._reviewers: deyam pap, meddle
Test_reviewers: Analysis_score: 0
Design_score: 3 Imp._score: 3
Test_score: 0

Description (last modified by stefan) (diff)

the following are all "timeline" related:
— Play
— Pause
— Play from beginning (rewinds and then plays)

  • Add these as link actions
    • Play timeline
    • Pause timeline
    • Stop timeline

Change History

comment:1 Changed 15 years ago by deyan

  • Importance changed from 79 to 91
  • Summary changed from link-actions-timeline to link-actions-timeline – Play, stop and pause for timelines

Batch update from file report_1.csv

comment:2 Changed 15 years ago by deyan

  • Priority changed from major to critical
  • Summary changed from link-actions-timeline – Play, stop and pause for timelines to link-actions-timeline – Play, stop and pause for timelines

Batch update from file 0911261.csv

comment:3 Changed 15 years ago by todor

  • Category set to unknown
  • Description modified (diff)
  • Analysis_score set to 0
  • Test_score set to 0
  • Summary changed from link-actions-timeline – Play, stop and pause for timelines to link-actions-timeline - Play, stop and pause for timelines
  • Design_score set to 0
  • Imp._score set to 0

comment:4 Changed 15 years ago by deyan

  • Owner set to deyan
  • Status changed from new to s1a_analysis_started
  • Description modified (diff)
  • Analysis_owners set to deyan

comment:5 Changed 15 years ago by deyan

  • Status changed from s1a_analysis_started to s1b_analysis_finished

comment:6 Changed 15 years ago by stefan

  • Design_owners set to stefan
  • Status changed from s1b_analysis_finished to s1c_analysis_ok
  • Imp._owners set to stefan
  • Description modified (diff)

comment:7 Changed 15 years ago by stefan

  • Owner changed from deyan to stefan
  • Status changed from s1c_analysis_ok to s2a_design_started

comment:8 Changed 15 years ago by stefan

code related design [8231]

comment:9 Changed 15 years ago by stefan

  • Status changed from s2a_design_started to s2b_design_finished

Design

In order to provide feature (link actions) for controlling the timelines (play, stop and pause) we added new package in the org.sophie2.main.func.links module called playing. It contains similar classes like the ones in the other packages of the org.sophie2.main.func.links module (like navigation and showing packages). They are as follows:

  • PauseTimelinesAction - extension of the LinkAction class that describes Pause functionality. It contains only the description of the functionality.
  • PauseTimelinesActionProvider - extension of the LinkActionProvider class that is used to provide PauseTimelineAction class.
  • PlayingActionLogic - extension of OperationDef. So, it contains definition of the logic for handling/filtering of the events that are used to describe the LinkAction of this task.
    • ON_PLAY_TIMELINE - Defines logic ( handling and filtering ) when PlayTimelinesAction is triggered.
    • ON_PAUSE_TIMELINE - Defines logic ( handling and filtering ) when PauseTimelinesAction is triggered.
    • ON_STOP_TIMELINE - Defines logic ( handling and filtering ) when StopTimelinesAction is triggered.
  • PlayTimelinesAction - extension of the LinkAction class that describes Play functionality. It contains only the description of the functionality.
  • PlayTimelinesActionProvider - extension of the LinkActionProvider class that is used to provide PlayTimelineAction class.
  • StopTimelinesAction - extension of the LinkAction class that describes Stop functionality. It contains only the description of the functionality.
  • StopTimelinesActionProvider - extension of the LinkActionProvider class that is used to provide StopTimelineAction class.

Other classes that are changed (some of them due to solving of the timing problem - when the timeline is paused or stopped) are as follows:

  • LinksModule - The providers and persisters are added as extensions.
  • BookTimeState - a field externalTime is added in order to keep track of the time passed in the book. It make sense only if the book (its timeline) is paused or stopped. Methods for getting it are provided.
  • BookView - The logic for changing (pause and stop) of the timelines has a direct relation to the BooTimeState's field externalTime. It is used in the getFuture() method for detecting the difference in milliseconds of the book and the actual time passed. Related code:
    ...
    if (!isPlaying()) { 
     	SophieLog.debug("book time= " + oldState.getBookTime().getMillis() + ", future time= " 
     	+ futureTime.getMillis()); 
     	return new BookTimeState(oldState.getBookTime(), oldState.getCurPage(), oldState 
     	.getPageTime(), futureTime); 
     }
    RootPageView oldPage = getCurrentPageView(); 
    TimelineOptions oldPageOptions = oldPage.model().get().getTimelineOptions(); 
    long distance = futureTime.getMillis() - oldState.getExternalTime().getMillis(); 
    long newTime = oldState.getBookTime().getMillis() + distance;  
    if (newTime < 0 || distance < 0) { 
           TimePos startTime = TimePos.createMain(0); 
           ResourceRefR4 pageRef = ResourceRefR4.getRelativeRef(this.getAccess().getRef(), oldPage.getAccess().getRef()); 
           return new BookTimeState(startTime, pageRef, startTime, startTime); 
    } 
    TimePos newBookTime = TimePos.createMain(newTime); 
    ...
    
  • BookR4 - KEY_PLAY_TIMELINESS is added in order to provide persistence of play/stop/pause link actions.
  • BooH - Getter for the KEY_PLAY_TIMELINES is added.

Also, in the org.sophie2.main.func.links.persist module all three (for play, pause and stop link actions) persisters are added. The are as follows:

  • PauseTimelinesActionPersister
  • PlayTimelinesActionPersister
  • StopTimelinesActionPersister

Because they are pretty much same, we'll provide only one example of the persist() method (for e.x. PauseTimelinesActionPersister):

...
 @Override
public void persist(ValueRef<PauseTimelinesAction> source, Storage target, PersistenceOptions options) throws IOException, IncorrectFormatException {

       if (options.isLoadMode()) {
           source.set(new PauseTimelinesAction());
       }
} 
...

comment:10 follow-up: ↓ 11 Changed 15 years ago by stefan

Design related code 8321?

comment:11 in reply to: ↑ 10 ; follow-up: ↓ 12 Changed 15 years ago by stefan

Replying to stefan:

Design related code 8231?

8231?

comment:12 in reply to: ↑ 11 Changed 15 years ago by stefan

Design related code [8231]

comment:13 Changed 15 years ago by pap

  • Status changed from s2b_design_finished to s2c_design_ok
  • Design_score changed from 0 to 3
  • Design_reviewers set to pap
  • Timline related link actions should be in the module providing other timeline functionality. If it wasn't so there wouldn't have been an extension point for link actions.
  • The KEY_PLAY_TIMELINES has nothing to do with the persistence of timeline link actions.
  • I am not reallly sure that the link actions about timelines should change the mentioned key in the model. As far as I imagine this key should determine whether timelines should be started when the book is loaded.
  • And the later needs some UI implemented (probably in the BookPropertiesDialog). Maybe this should be another ticket.
  • Please give some opinion on these.
  • Also I think that when you need to create a new Immutable object by changing only one of its characteristics it is better to write a modify method that makin new MyImmutableObject(oldValue, oldValue, newValue, oldValue). Saves lines and is much more easier to understand than a 4-parameter constructor.
  • Also is the timelines stop logic really correct?

comment:14 Changed 15 years ago by stefan

  • Status changed from s2c_design_ok to s3a_implementation_started

Change sets:

  • [8231]
  • [8318] - changes made due to design's review comments.

comment:15 Changed 15 years ago by stefan

  • Status changed from s3a_implementation_started to s3b_implementation_finished

comment:16 Changed 15 years ago by stefan

The review of the implementation showed that Play - Pause - Stop link action didn't cause timeline to get to position 0.
[8323] - fix for the Play - Pause - Stop interaction.

comment:17 Changed 15 years ago by pap

  • Status changed from s3b_implementation_finished to s3c_implementation_ok
  • Imp._score changed from 0 to 3
  • Imp._reviewers set to deyam pap, meddle
  • Ok but.
  • You are using Control+Shift+F too much.
  • There is no sense in making class constructors without parameters that do nothing.
  • Calling super() in a constructor is sensless - this is done automatically.
  • I see no improvements from the design but the location of the actions.
  • Also the descriptions of the actions were not good enough.]
  • And you had to fix some things on the fly.
  • Commited to trunk in [8337].

comment:18 Changed 15 years ago by pap

  • Cc stefan added

adding cc

comment:19 Changed 13 years ago by meddle

  • Status changed from s3c_implementation_ok to closed
  • Resolution set to obsolete

Closing all the tickets before M Y1

Note: See TracTickets for help on using tickets.