OSDN Git Service

ファイルダウンロードでファイル名をカメラのファイル名と一致させるようにした。(FUJI)
[gokigen/Gr2Control.git] / app / src / main / java / net / osdn / gokigen / gr2control / camera / fuji_x / wrapper / playback / FujiXPlaybackControl.java
index 9fc3855..211d1f8 100644 (file)
@@ -81,6 +81,7 @@ public class FujiXPlaybackControl implements IPlaybackControl, IFujiXCommandCall
     public void updateCameraFileInfo(ICameraFileInfo info)
     {
         //  なにもしない
+        Log.v(TAG, " updateCameraFileInfo() : " + info.getDatetime());
     }
 
     @Override
@@ -100,7 +101,7 @@ public class FujiXPlaybackControl implements IPlaybackControl, IFujiXCommandCall
             {
                 start = 1;
             }
-            Log.v(TAG, "downloadContentThumbnail() : " + path + " " + name);
+            Log.v(TAG, "  downloadContentThumbnail() : " + path + " " + name);
             int index = getIndexNumber(start, name);
             if ((index > 0)&&(index <= imageContentInfo.size()))
             {
@@ -129,10 +130,8 @@ public class FujiXPlaybackControl implements IPlaybackControl, IFujiXCommandCall
             {
                 start = 1;
             }
-            String indexStr = name.substring(start, name.indexOf("."));
-            Log.v(TAG, "FujiX::downloadContent() : " + path + " " + name + " " + indexStr);
-            int index = Integer.parseInt(indexStr);
-            //FujiXImageContentInfo contentInfo = imageContentInfo.get(index);   // 特にデータを更新しないから大丈夫か?
+            int index = getIndexNumber(start, name);
+            Log.v(TAG, "  FujiX::downloadContent() : " + path + " " + name + " " + index);
             if ((index > 0)&&(index <= imageContentInfo.size()))
             {
                 IFujiXCommandPublisher publisher = provider.getCommandPublisher();
@@ -180,13 +179,35 @@ public class FujiXPlaybackControl implements IPlaybackControl, IFujiXCommandCall
     @Override
     public void showPictureStarted()
     {
+        try
+        {
+            Log.v(TAG, "   showPictureStarted() ");
 
+            IFujiXCommandPublisher publisher = provider.getCommandPublisher();
+            publisher.flushHoldQueue();
+            System.gc();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
     }
 
     @Override
     public void showPictureFinished()
     {
+        try
+        {
+            Log.v(TAG, "   showPictureFinished() ");
 
+            IFujiXCommandPublisher publisher = provider.getCommandPublisher();
+            publisher.flushHoldQueue();
+            System.gc();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
     }
 
     private void getCameraContents(ICameraContentListCallback callback)
@@ -329,6 +350,7 @@ public class FujiXPlaybackControl implements IPlaybackControl, IFujiXCommandCall
 
     private List<ICameraFileInfo> getCameraFileInfoList()
     {
+        Log.v(TAG, " FujiXPlaybackControl::getCameraFileInfoList() ");
         List<ICameraFileInfo> fileInfoList = new ArrayList<>();
         try
         {
@@ -336,7 +358,7 @@ public class FujiXPlaybackControl implements IPlaybackControl, IFujiXCommandCall
             for(int index = 0; index < listSize; index++)
             {
                 FujiXImageContentInfo info = imageContentInfo.valueAt(index);
-                fileInfoList.add(info.getCameraFileInfo());
+                fileInfoList.add(info);
             }
         }
         catch (Exception e)