Ticket #2198 (closed feature: obsolete)

Opened 10 years ago

Last modified 8 years ago

media-hud-clip - Set up clipping from the HUD

Reported by: deyan Owned by: stefan
Priority: critical Milestone: X3
Component: uncategorized Version: 2.0
Keywords: Cc:
Category: unknown Effort:
Importance: 85 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: stefan Changelog:
Design_reviewers: pap Imp._reviewers: pap
Test_reviewers: Analysis_score: 0
Design_score: 3 Imp._score: 3
Test_score: 0

Description (last modified by deyan) (diff)

Media HUD should allow clipping.

  • Create media halo and hud like these for browser frame
  • Create start time, end time fields, and looped checkbox
  • The frame should look like its content is the clip, not the whole movie.
  • The fields should be bound controls

Change History

comment:1 Changed 10 years ago by deyan

  • Priority changed from major to critical
  • Summary changed from media-hud-clip – Set up clipping from the HUD to media-hud-clip – Set up clipping from the HUD

Batch update from file 0911261.csv

comment:2 Changed 10 years ago by todor

  • Category set to unknown
  • Analysis_score set to 0
  • Test_score set to 0
  • Summary changed from media-hud-clip – Set up clipping from the HUD to media-hud-clip - Set up clipping from the HUD
  • Design_score set to 0
  • Imp._score set to 0

comment:3 Changed 10 years ago by deyan

  • Owner set to deyan
  • Status changed from new to s1a_analysis_started

Media HUD should allow clipping.

  • Create media halo and hud like these for browser frame
  • Create start time, end time fields, and looped checkbox
  • The frame should look like its content is the clip, not the whole movie.

comment:4 Changed 10 years ago by deyan

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

comment:5 Changed 10 years ago by stefan

  • Status changed from s1b_analysis_finished to s1c_analysis_ok

comment:6 Changed 10 years ago by stefan

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

comment:7 Changed 10 years ago by stefan

  • Status changed from s2a_design_started to s2b_design_finished

Design

Closely related tickets:

  • #2197 - media-hud-looped - Set up looped from the HUD (it is implemented in the same branch as this ticket).
  • #2180 - media-hud-controls - Toggle show of media controls. (it is not implemented yet).

Main idea of this ticket is to provide methods to the user for changing the start and end points of media files (so called clipping). Classes and methods added or changed in order to provide this functionality are as follows:

  • MediaClip - class that contains needed information (basically markers for the start and end position of the clip). Here is important to note that, whether some media is clipped or not, can be determent by the values of the start and end position in the media clip for the corresponding file - if the start position is 0 and the end position is less that 0, usually -1, means that media is not clipped, or the method isClipped() can be used instead.
  • KEY_CLIP - a key that is in the MediaFrameR4. It holds the MediaClip for the current media frame and has default value of MediaClip.DEFAULT_CLIP, which has start = 0 and end = -1 - it doesn't clip media.
    • MediaClipPersister - a class which provides persistence for MediaClip. It has no deep logic, only basic persistence of the two fields in the class persisted - the start and end seconds.
    • MediaClipPersisterTest - a standard test for persistence of the MediaClipPersister.
  • MediaFrameView - a method calculatePosition(TimePos time) is added to this class in order to provide correct playing position, in respect of clipping and looping. For detail information regarding this method, see #2197 ticket.
  • MediaPropertiesHud - a class that represent the hud in which controls for changing the clipping are included. (it is also used in #2197 ticket, so we'll only describe the code used for this ticket). Code of significance in this class:
    • The code that follows represent bound text field for the start position of the clipping. As you can see, a valid field data is a double number (in seconds) within [0, length] interval, where {{{length}} is the length of the media in seconds.
      /**
       * Text box for controlling the start position of the media clipping. It
       * accepts only float values.
       * 
       * @author stefan
       * 
       */
      @VisualElementDef(parent = MediaPropertiesHud.class, sortKey = "eee-media-clip-start") public static class ClipStartPosition extends BoundTextField { ...
      @Override
      		protected BoundValidation validate(String fieldString) {
      			if (fieldString.equals("")) {
      				return BoundValidation.SUCCESS;
      			}
      			MediaPropertiesHud hud = findParentElement(MediaPropertiesHud.class);
      			MediaFrameH helper = hud.mediaFrameH().get();
      			double duration = hud.mediaFrameView().get().handler().get()
      					.getInfo().getDuration();
      			return BoundValidation.validateNumber(fieldString, Double.class,
      					helper.getMediaClip().getStartSecond(), duration,
      					"Media start position should be between %g and %g");
      
      		}
      ... }
      ...
      
  • The code that follows represent bound text field for the end position of the clipping. As you can see, a valid field data is a double number (in seconds) within [start, length] interval, where start is the start position kept in the corresponding MediaClip (default value is 0) and {{{length}} is the length of the media in seconds.
    	/**
    	 * Text box for controlling the end position of the media clipping. It
    	 * accepts only float values.
    	 * 
    	 * @author stefan
    	 * 
    	 */
    	@VisualElementDef(parent = MediaPropertiesHud.class, sortKey = "fff-media-clip-end")
    	public static class ClipEndPosition extends BoundTextField {
    	...
      @Override
    		protected BoundValidation validate(String fieldString) {
    			if (fieldString.equals("")) {
    				return BoundValidation.SUCCESS;
    			}
    			MediaPropertiesHud hud = findParentElement(MediaPropertiesHud.class);
    
    			MediaFrameH helper = hud.mediaFrameH().get();
    			double duration = hud.mediaFrameView().get().handler().get()
    					.getInfo().getDuration();
    			return BoundValidation.validateNumber(fieldString, Double.class,
    					helper.getMediaClip().getStartSecond(), duration,
    					"Media start position should be between %g and %g");
    
    		}
    	...
    
  • MediaPropertiesHaloButton - A halo button for viewing the Hud.
  • MediaLogic - In the ON_PLAY_PAUSE_MEDIA operation, the calculation of the duration is changed (because the clipping of media changes the duration of the clip. The related code:
     long duration = MediaUtil.getMillis(view.handler().get().getInfo().getDuration());
     if (model.isClipped()) {
    	if (model.getMediaClip().getEndSecond() < 0) {
    		duration -= MediaUtil.getMillis(model.getMediaClip().getStartSecond());
            } else {
    		duration = MediaUtil.getMillis(model.getMediaClip().getDuration());
    	}
     }
    
  • SeekMediaManipulationView - Here also is added similar code that take in consideration the clipping of the media. Due to similarity of the code, I will not present it.
  • MediaFrameView - Same as above.

Design Related Code

comment:8 Changed 10 years ago by stefan

  • Design_owners set to stefan
  • Imp._owners set to stefan
  • Analysis_reviewers set to stefan

comment:9 Changed 10 years ago by stefan

[8333] - Fix for validation of the start position of the media clip.

comment:10 Changed 10 years ago by pap

  • Status changed from s2b_design_finished to s3c_implementation_ok
  • Design_score changed from 0 to 3
  • Design_reviewers set to pap
  • Imp._score changed from 0 to 3
  • Imp._reviewers set to pap

comment:11 Changed 8 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.