Flip Overview

 

Document Format, Conversion

Flip provides an unique document format. Document versions are maintained so that it allows document from different versions to be converted to some other version. Convenient classes are provided for the latter to simplify work.

Document Format

Flip comes with its document format, which is the only back-end for flip model persistent writes. The document format was designed to be easily read by a client (to detect problems) as well as parsed very fast (rather than using XML). The format itself is very similar to PDF, but only for its structural part. This allows for future extension easily, should it be needed.

Note:The format is similar to the PDF format but is not the PDF format

The listing below shows a piece of a typical document as stored by Flip.

%OSF-1.0
1 obj <<
   /ClassName ohm.studio.Root
      /AttributeName _client_data_coll /Type /Collection /Ref ( 2251799813685249 )
      /AttributeName _client_audio_midi_data_coll /Type /Collection /Ref ( 2533274790395907 )
      /AttributeName _tempo_coll /Type /Collection /Ref ( 9 )
      /AttributeName _signature_coll /Type /Collection /Ref ( 12 )
      /AttributeName _rack_arr /Type /Array /Ref [ 0.880cb2e 16 0.f8f4c6c1f4c 44 0.fe4bf19e79ce58 2533274790395910 ]
      /AttributeName _connection_coll /Type /Collection /Ref ( 81 2533274790395996 )
      /AttributeName _sample_coll /Type /Collection /Ref ( 2533274790396001 2533274790396030 )
>>
endobj
2251799813685249 obj <<
   /ClassName ohm.studio.ClientData
      /AttributeName _user_name /Type /Blob /Inline /Length 11 /Filter [ /EscapedAsciiDecode ] main_client
      /AttributeName _focus_region /Type /Enum ohm.studio.ClientData.FocusRegion /Value FocusRegion_SEQUENCE
      /AttributeName _primary_tool_cue /Type /Cue
      /AttributeName _momentary_tool_cue /Type /Cue
      /AttributeName _tool_state_cue /Type /Cue
      /AttributeName _current_pattern_instance_cue /Type /Cue
      /AttributeName _snap_flag /Type /Bool /Value /true
      /AttributeName _snap_time /Type /Float64 /Value 0x3fd0000000000000
      /AttributeName _snap_relative_flag /Type /Bool /Value /true
      /AttributeName _snap_adaptative_flag /Type /Bool /Value /true
      /AttributeName _click_flag /Type /Bool /Value /false
      /AttributeName _click_freq /Type /Int64 /Value 4
      /AttributeName _click_norm_vol /Type /Float64 /Value 0x3ff0000000000000
      /AttributeName _selection_sequence /Type /Object /Ref 2251799813685263
      /AttributeName _selection_plugin_rack /Type /Object /Ref 2251799813685265
      /AttributeName _selection_inspector /Type /Object /Ref 2251799813685267
      /AttributeName _view_layout_info /Type /Object /Ref 2251799813685269
      /AttributeName _view_sequence_info /Type /Object /Ref 2251799813685272
      /AttributeName _view_plugin_rack_info /Type /Object /Ref 2251799813685293
      /AttributeName _view_mix_info /Type /Object /Ref 2251799813685301
      /AttributeName _view_inspector_info /Type /Object /Ref 2251799813685311
      /AttributeName _playhead_info /Type /Object /Ref 2251799813685312
      /AttributeName _soundcloud_info /Type /Object /Ref 2251799813685319
>>
endobj
2251799813685263 obj <<
   /ClassName ohm.studio.Selection
      /AttributeName _coll /Type /Collection /Ref ( )
>>
endobj
[... skipped content ...]
xref
58
0000000010
0000000633
[... skipped content ...]
trailer <<
   /Root 1
   /Revision 72
   /Version OhmStudio.Beta.Rev69859
   /User main_client /Id 1
>>
startxref
22925
%%EOF

The document can be easily navigated by using a simple text editor (typically your IDE editor) and its bundled “find” feature. With a little experience, navigating file even as big as 100 MBytes is not a big issue.

Conversion

Bundled with Flip comes a set of convenience classes to ease the conversion process of converting, for example, a document from its 1.0 format to it 2.0 format.

The client provides a version tree, and how to transition from one version format to another. This way, a complex version system can be easily maintained, allowing even A/B testing.

The convenient classes themselves decode the document to show it already structured, but with strings. This allows not to maintain model of older versions, while keeping the old model structure implicitely in the conversion classes.

The convenient classes also allow for easy insertion/deletion of members, global tree manipulation, etc.