@@ -307,18 +307,6 @@ struct Keys {
307307        static  let  keepAspectRatio =  " General.FullscreenKeepAspectRatio " 
308308        static  let  exitOnEsc =  " General.FullscreenExitOnEsc " 
309309
310-         // Snapshots
311-         static  let  snapshotStorage =  " General.SnapshotStorage " 
312-         static  let  autoSnapshots =  " General.AutoSnapshots " 
313-         static  let  autoSnapshotInterval =  " General.ScreenshotInterval " 
314- 
315-         // Screenshots
316-         static  let  screenshotFormat =  " General.ScreenshotFormat " 
317-         static  let  screenshotSource =  " General.ScreenshotSource " 
318-         static  let  screenshotCutout =  " General.ScreenshotCutout " 
319-         static  let  screenshotWidth =  " General.ScreenshotWidth " 
320-         static  let  screenshotHeight =  " General.ScreenshotHeight " 
321- 
322310        // Miscellaneous
323311        static  let  ejectWithoutAsking =  " General.EjectWithoutAsking " 
324312        static  let  detachWithoutAsking =  " General.DetachWithoutAsking " 
@@ -338,18 +326,6 @@ extension DefaultsProxy {
338326        register ( Keys . Gen. keepAspectRatio,  false ) 
339327        register ( Keys . Gen. exitOnEsc,  true ) 
340328
341-         // Snapshots
342-         register ( Keys . Gen. snapshotStorage,  512 ) 
343-         register ( Keys . Gen. autoSnapshots,  false ) 
344-         register ( Keys . Gen. autoSnapshotInterval,  20 ) 
345- 
346-         // Screenshots
347-         register ( Keys . Gen. screenshotFormat,  NSBitmapImageRep . FileType. png. rawValue) 
348-         register ( Keys . Gen. screenshotSource,  0 ) 
349-         register ( Keys . Gen. screenshotCutout,  0 ) 
350-         register ( Keys . Gen. screenshotWidth,  1200 ) 
351-         register ( Keys . Gen. screenshotHeight,  900 ) 
352- 
353329        // Misc
354330        register ( Keys . Gen. ejectWithoutAsking,  false ) 
355331        register ( Keys . Gen. detachWithoutAsking,  false ) 
@@ -364,16 +340,6 @@ extension DefaultsProxy {
364340        let  keys  =  [  Keys . Gen. keepAspectRatio, 
365341                     Keys . Gen. exitOnEsc, 
366342
367-                      Keys . Gen. snapshotStorage, 
368-                      Keys . Gen. autoSnapshots, 
369-                      Keys . Gen. autoSnapshotInterval, 
370-                                           
371-                      Keys . Gen. screenshotFormat, 
372-                      Keys . Gen. screenshotSource, 
373-                      Keys . Gen. screenshotCutout, 
374-                      Keys . Gen. screenshotWidth, 
375-                      Keys . Gen. screenshotHeight, 
376- 
377343                     Keys . Gen. ejectWithoutAsking, 
378344                     Keys . Gen. detachWithoutAsking, 
379345                     Keys . Gen. closeWithoutAsking, 
@@ -395,16 +361,6 @@ extension Preferences {
395361        defaults. set ( Keys . Gen. keepAspectRatio,  keepAspectRatio) 
396362        defaults. set ( Keys . Gen. exitOnEsc,  exitOnEsc) 
397363
398-         defaults. set ( Keys . Gen. snapshotStorage,  snapshotStorage) 
399-         defaults. set ( Keys . Gen. autoSnapshots,  autoSnapshots) 
400-         defaults. set ( Keys . Gen. autoSnapshotInterval,  snapshotInterval) 
401-                 
402-         defaults. set ( Keys . Gen. screenshotFormat,  screenshotFormatIntValue) 
403-         defaults. set ( Keys . Gen. screenshotSource,  screenshotSourceIntValue) 
404-         defaults. set ( Keys . Gen. screenshotCutout,  screenshotCutoutIntValue) 
405-         defaults. set ( Keys . Gen. screenshotWidth,  screenshotWidth) 
406-         defaults. set ( Keys . Gen. screenshotHeight,  screenshotHeight) 
407- 
408364        defaults. set ( Keys . Gen. ejectWithoutAsking,  ejectWithoutAsking) 
409365        defaults. set ( Keys . Gen. detachWithoutAsking,  detachWithoutAsking) 
410366        defaults. set ( Keys . Gen. closeWithoutAsking,  closeWithoutAsking) 
@@ -421,16 +377,6 @@ extension Preferences {
421377        keepAspectRatio =  defaults. bool ( Keys . Gen. keepAspectRatio) 
422378        exitOnEsc =  defaults. bool ( Keys . Gen. exitOnEsc) 
423379
424-         snapshotStorage =  defaults. int ( Keys . Gen. snapshotStorage) 
425-         autoSnapshots =  defaults. bool ( Keys . Gen. autoSnapshots) 
426-         snapshotInterval =  defaults. int ( Keys . Gen. autoSnapshotInterval) 
427- 
428-         screenshotFormatIntValue =  defaults. int ( Keys . Gen. screenshotFormat) 
429-         screenshotSourceIntValue =  defaults. int ( Keys . Gen. screenshotSource) 
430-         screenshotCutoutIntValue =  defaults. int ( Keys . Gen. screenshotCutout) 
431-         screenshotWidth =  defaults. int ( Keys . Gen. screenshotWidth) 
432-         screenshotHeight =  defaults. int ( Keys . Gen. screenshotHeight) 
433- 
434380        ejectWithoutAsking =  defaults. bool ( Keys . Gen. ejectWithoutAsking) 
435381        detachWithoutAsking =  defaults. bool ( Keys . Gen. detachWithoutAsking) 
436382        closeWithoutAsking =  defaults. bool ( Keys . Gen. closeWithoutAsking) 
@@ -447,12 +393,17 @@ extension Keys {
447393
448394    struct  Cap  { 
449395
450-         // Videos
451-         static  let  ffmpegPath =  " General.ffmpegPath " 
452-         static  let  captureSource =  " General.Source " 
453-         static  let  bitRate =  " General.BitRate " 
454-         static  let  aspectX =  " General.AspectX " 
455-         static  let  aspectY =  " General.AspectY " 
396+         // Snapshots
397+         static  let  snapshotStorage =  " Cap.SnapshotStorage " 
398+         static  let  autoSnapshots =  " Cap.AutoSnapshots " 
399+         static  let  autoSnapshotInterval =  " Cap.ScreenshotInterval " 
400+ 
401+         // Screenshots
402+         static  let  screenshotFormat =  " Cap.ScreenshotFormat " 
403+         static  let  screenshotSource =  " Cap.ScreenshotSource " 
404+         static  let  screenshotCutout =  " Cap.ScreenshotCutout " 
405+         static  let  screenshotWidth =  " Cap.ScreenshotWidth " 
406+         static  let  screenshotHeight =  " Cap.ScreenshotHeight " 
456407    } 
457408} 
458409
@@ -463,23 +414,32 @@ extension DefaultsProxy {
463414
464415        debug ( . defaults) 
465416
466-         // Videos
467-         register ( Keys . Cap. ffmpegPath,  " " ) 
468-         register ( Keys . Cap. captureSource,  0 ) 
469-         register ( Keys . Cap. bitRate,  2048 ) 
470-         register ( Keys . Cap. aspectX,  768 ) 
471-         register ( Keys . Cap. aspectY,  702 ) 
417+         // Snapshots
418+         register ( Keys . Cap. snapshotStorage,  512 ) 
419+         register ( Keys . Cap. autoSnapshots,  false ) 
420+         register ( Keys . Cap. autoSnapshotInterval,  20 ) 
421+ 
422+         // Screenshots
423+         register ( Keys . Cap. screenshotFormat,  NSBitmapImageRep . FileType. png. rawValue) 
424+         register ( Keys . Cap. screenshotSource,  0 ) 
425+         register ( Keys . Cap. screenshotCutout,  0 ) 
426+         register ( Keys . Cap. screenshotWidth,  1200 ) 
427+         register ( Keys . Cap. screenshotHeight,  900 ) 
472428    } 
473429
474430    func  removeCapturesUserDefaults( )  { 
475431
476432        debug ( . defaults) 
477433
478-         let  keys  =  [  Keys . Cap. ffmpegPath, 
479-                      Keys . Cap. captureSource, 
480-                      Keys . Cap. bitRate, 
481-                      Keys . Cap. aspectX, 
482-                      Keys . Cap. aspectY, 
434+         let  keys  =  [  Keys . Cap. snapshotStorage, 
435+                      Keys . Cap. autoSnapshots, 
436+                      Keys . Cap. autoSnapshotInterval, 
437+ 
438+                      Keys . Cap. screenshotFormat, 
439+                      Keys . Cap. screenshotSource, 
440+                      Keys . Cap. screenshotCutout, 
441+                      Keys . Cap. screenshotWidth, 
442+                      Keys . Cap. screenshotHeight, 
483443        ] 
484444
485445        for  key  in  keys {  removeKey ( key)  } 
@@ -494,12 +454,16 @@ extension Preferences {
494454        debug ( . defaults) 
495455        let  defaults  =  EmulatorProxy . defaults!
496456
497-         defaults. set ( Keys . Cap. ffmpegPath,  ffmpegPath) 
498-         defaults. set ( Keys . Cap. captureSource,  captureSourceIntValue) 
499-         defaults. set ( Keys . Cap. bitRate,  bitRate) 
500-         defaults. set ( Keys . Cap. aspectX,  aspectX) 
501-         defaults. set ( Keys . Cap. aspectY,  aspectY) 
502-                 
457+         defaults. set ( Keys . Cap. snapshotStorage,  snapshotStorage) 
458+         defaults. set ( Keys . Cap. autoSnapshots,  autoSnapshots) 
459+         defaults. set ( Keys . Cap. autoSnapshotInterval,  snapshotInterval) 
460+ 
461+         defaults. set ( Keys . Cap. screenshotFormat,  screenshotFormatIntValue) 
462+         defaults. set ( Keys . Cap. screenshotSource,  screenshotSourceIntValue) 
463+         defaults. set ( Keys . Cap. screenshotCutout,  screenshotCutoutIntValue) 
464+         defaults. set ( Keys . Cap. screenshotWidth,  screenshotWidth) 
465+         defaults. set ( Keys . Cap. screenshotHeight,  screenshotHeight) 
466+ 
503467        defaults. save ( ) 
504468    } 
505469
@@ -508,11 +472,15 @@ extension Preferences {
508472        debug ( . defaults) 
509473        let  defaults  =  EmulatorProxy . defaults!
510474
511-         ffmpegPath =  defaults. string ( Keys . Cap. ffmpegPath) 
512-         captureSourceIntValue =  defaults. int ( Keys . Cap. captureSource) 
513-         bitRate =  defaults. int ( Keys . Cap. bitRate) 
514-         aspectX =  defaults. int ( Keys . Cap. aspectX) 
515-         aspectY =  defaults. int ( Keys . Cap. aspectY) 
475+         snapshotStorage =  defaults. int ( Keys . Cap. snapshotStorage) 
476+         autoSnapshots =  defaults. bool ( Keys . Cap. autoSnapshots) 
477+         snapshotInterval =  defaults. int ( Keys . Cap. autoSnapshotInterval) 
478+ 
479+         screenshotFormatIntValue =  defaults. int ( Keys . Cap. screenshotFormat) 
480+         screenshotSourceIntValue =  defaults. int ( Keys . Cap. screenshotSource) 
481+         screenshotCutoutIntValue =  defaults. int ( Keys . Cap. screenshotCutout) 
482+         screenshotWidth =  defaults. int ( Keys . Cap. screenshotWidth) 
483+         screenshotHeight =  defaults. int ( Keys . Cap. screenshotHeight) 
516484    } 
517485} 
518486
0 commit comments