Package net.pms.dlna.virtual

Examples of net.pms.dlna.virtual.VirtualFolder


    XBMCLog.logTimeStart("loading movie info from DB");
    final TitleInfo info = dao.getTitleByID(titleId);
    XBMCLog.logTimeStop();

    if (info == null) {
      addChild(new VirtualFolder("NOT FOUND CHECK LOG", null));
      return;
    }

    if (!info.getFile().exists()) {
      addChild(new VirtualFolder("<FILE IS MISSING>", null));
      return;
    }
    addChild(new VirtualFolder("Title: " + info.getName(), null));

    XBMCLog.logTimeStart("adding title file");
    addChild(new RealFile(info.getFile()) {
      @Override
      public String getName() {
        return "Play";
      }

      @Override
      public void startPlaying(String rendererId) {
        super.startPlaying(rendererId);
        info.setWatched(info.getWatched() + 1);
        dao.updateWatched(info);
      }
    });
    XBMCLog.logTimeStop();

   
    if (info.getTagline() != null && info.getTagline().length() > 0) {
      addChild(new VirtualFolder("Tagline: " + info.getTagline(), null));
    }
    if (info.getRunningTime() != null && info.getRunningTime().length() > 0) {
      addChild(new VirtualFolder("Running Time: " + info.getRunningTime() + "min", null));
    }
    if (info.getAge() != null && info.getAge().length() > 0) {
      addChild(new VirtualFolder("Age: " + info.getAge(), null));
    }
    if (info.getGenre() != null && info.getGenre().length() > 0) {
      addChild(new VirtualFolder("Genre: " + info.getGenre(), null));
    }
    if (info.getSinopsis() != null && info.getSinopsis().length() > 0) {
      addChild(new VirtualFolder("Sinopsis: " + info.getSinopsis(), null));
    }
    if (info.getDirector() != null && info.getDirector().length() > 0) {
      addChild(new VirtualFolder("Director: " + info.getDirector(), null));
    }
    if (info.getWriter() != null && info.getWriter().length() > 0) {
      addChild(new VirtualFolder("Writer: " + info.getWriter(), null));
    }
    if (info.getRating() != null && info.getRating().length() > 0) {
      addChild(new VirtualFolder("IMDB Rating: " + info.getRating(), null));
    }
    if (info.getCountry() != null && info.getCountry().length() > 0) {
      addChild(new VirtualFolder("Country: " + info.getCountry(), null));
    }
    if (info.getStudio() != null && info.getStudio().length() > 0) {
      addChild(new VirtualFolder("Studio: " + info.getStudio(), null));
    }
    if (info.getVideoCodec() != null && info.getVideoCodec().length() > 0) {
      addChild(new VirtualFolder("Video CODEC: " + info.getVideoCodec(), null));
    }
    if (info.getVideoRes() != null && info.getVideoRes().length() > 0) {
      addChild(new VirtualFolder("Video Size: " + info.getVideoRes(), null));
    }
    if (info.getAudioCodec() != null && info.getAudioCodec().length() > 0) {
      addChild(new VirtualFolder("Audio CODEC: " + info.getAudioCodec(), null));
    }
    if (info.getAudioChannels() != null && info.getAudioChannels().length() > 0) {
      addChild(new VirtualFolder("Audio Channels: " + info.getAudioChannels(), null));
    }
    if (info.getEpisode() != null && info.getEpisode().length() > 0) {
      addChild(new VirtualFolder("Season/Episode: " + info.getEpisode(), null));
    }
    addChild(new VirtualFolder("Watched: ", info.getWatched() + " times") {
      @Override
      public String getName() {
        return "Watched: " + info.getWatched() + " times";
      }
    });
View Full Code Here


  private PMSXBMCConfig configWindow;
  private VirtualFolder plugRoot;

  public PMSXBMCPlugin() {
    XBMCLog.info("creating root folder");
    plugRoot = new VirtualFolder(name(), null);

    XBMCLog.info("adding video folder");
    plugRoot.addChild(new VideoFolder("Videos", null));

    XBMCLog.info("adding music folder");
View Full Code Here

                    while (st.hasMoreTokens()) {
                      String folder = st.nextToken();
                      parent = currentRoot.searchByName(folder);

                      if (parent == null) {
                        parent = new VirtualFolder(folder, "");
                        currentRoot.addChild(parent);
                      }

                      currentRoot = parent;
                    }
View Full Code Here

   * Mac OS X only.
   *
   * @return iPhotoVirtualFolder the populated <code>VirtualFolder</code>, or null if one couldn't be created.
   */
  private DLNAResource getiPhotoFolder() {
    VirtualFolder iPhotoVirtualFolder = null;

    if (Platform.isMac()) {
      LOGGER.debug("Adding iPhoto folder");
      InputStream inputStream = null;

      try {
        // This command will show the XML files for recently opened iPhoto databases
        Process process = Runtime.getRuntime().exec("defaults read com.apple.iApps iPhotoRecentDatabases");
        inputStream = process.getInputStream();
        List<String> lines = IOUtils.readLines(inputStream);
        LOGGER.debug("iPhotoRecentDatabases: {}", lines);

        if (lines.size() >= 2) {
          // we want the 2nd line
          String line = lines.get(1);

          // Remove extra spaces
          line = line.trim();

          // Remove quotes
          line = line.substring(1, line.length() - 1);

          URI uri = new URI(line);
          URL url = uri.toURL();
          File file = FileUtils.toFile(url);
          LOGGER.debug("Resolved URL to file: {} -> {}", url, file.getAbsolutePath());

          // Load the properties XML file.
          Map<String, Object> iPhotoLib = Plist.load(file);

          // The list of all photos
          Map<?, ?> photoList = (Map<?, ?>) iPhotoLib.get("Master Image List");

          // The list of events (rolls)
          List<Map<?, ?>> listOfRolls = (List<Map<?, ?>>) iPhotoLib.get("List of Rolls");

          iPhotoVirtualFolder = new VirtualFolder("iPhoto Library", null);

          for (Map<?, ?> roll : listOfRolls) {
            Object rollName = roll.get("RollName");

            if (rollName != null) {
              VirtualFolder virtualFolder = new VirtualFolder(rollName.toString(), null);

              // List of photos in an event (roll)
              List<?> rollPhotos = (List<?>) roll.get("KeyList");

              for (Object photo : rollPhotos) {
                Map<?, ?> photoProperties = (Map<?, ?>) photoList.get(photo);

                if (photoProperties != null) {
                  Object imagePath = photoProperties.get("ImagePath");

                  if (imagePath != null) {
                    RealFile realFile = new RealFile(new File(imagePath.toString()));
                    virtualFolder.addChild(realFile);
                  }
                }
              }

              iPhotoVirtualFolder.addChild(virtualFolder);
View Full Code Here

   * Returns Aperture folder. Used by manageRoot, so it is usually used as
   * a folder at the root folder. Only works when PMS is run on Mac OS X.
   * TODO: Requirements for Aperture.
   */
  private DLNAResource getApertureFolder() {
    VirtualFolder res = null;

    if (Platform.isMac()) {
      Process process = null;

      try {
        process = Runtime.getRuntime().exec("defaults read com.apple.iApps ApertureLibraries");
        try (BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
          // Every line entry is one aperture library. We want all of them as a dlna folder.
          String line;
          res = new VirtualFolder("Aperture libraries", null);

          while ((line = in.readLine()) != null) {
            if (line.startsWith("(") || line.startsWith(")")) {
              continue;
            }

            line = line.trim(); // remove extra spaces
            line = line.substring(1, line.lastIndexOf('"')); // remove quotes and spaces
            VirtualFolder apertureLibrary = createApertureDlnaLibrary(line);

            if (apertureLibrary != null) {
              res.addChild(apertureLibrary);
            }
          }
View Full Code Here

    return res;
  }

  private VirtualFolder createApertureDlnaLibrary(String url) throws UnsupportedEncodingException, MalformedURLException, XmlParseException, IOException, URISyntaxException {
    VirtualFolder res = null;

    if (url != null) {
      Map<String, Object> iPhotoLib;
      // every project is a album, too
      List<?> listOfAlbums;
      Map<?, ?> album;
      Map<?, ?> photoList;

      URI tURI = new URI(url);
      iPhotoLib = Plist.load(URLDecoder.decode(tURI.toURL().getFile(), System.getProperty("file.encoding"))); // loads the (nested) properties.
      photoList = (Map<?, ?>) iPhotoLib.get("Master Image List"); // the list of photos
      final Object mediaPath = iPhotoLib.get("Archive Path");
      String mediaName;

      if (mediaPath != null) {
        mediaName = mediaPath.toString();

        if (mediaName != null && mediaName.lastIndexOf('/') != -1 && mediaName.lastIndexOf(".aplibrary") != -1) {
          mediaName = mediaName.substring(mediaName.lastIndexOf('/'), mediaName.lastIndexOf(".aplibrary"));
        } else {
          mediaName = "unknown library";
        }
      } else {
        mediaName = "unknown library";
      }

      LOGGER.info("Going to parse aperture library: " + mediaName);
      res = new VirtualFolder(mediaName, null);
      listOfAlbums = (List<?>) iPhotoLib.get("List of Albums"); // the list of events (rolls)

      for (Object item : listOfAlbums) {
        album = (Map<?, ?>) item;

        if (album.get("Parent") == null) {
          VirtualFolder vAlbum = createApertureAlbum(photoList, album, listOfAlbums);
          res.addChild(vAlbum);
        }
      }
    } else {
      LOGGER.info("No Aperture library found.");
View Full Code Here

    Map<?, ?> album, List<?> listOfAlbums
  ) {

    List<?> albumPhotos;
    int albumId = (Integer) album.get("AlbumId");
    VirtualFolder vAlbum = new VirtualFolder(album.get("AlbumName").toString(), null);

    for (Object item : listOfAlbums) {
      Map<?, ?> sub = (Map<?, ?>) item;

      if (sub.get("Parent") != null) {
        // recursive album creation
        int parent = (Integer) sub.get("Parent");

        if (parent == albumId) {
          VirtualFolder subAlbum = createApertureAlbum(photoList, sub, listOfAlbums);
          vAlbum.addChild(subAlbum);
        }
      }
    }
View Full Code Here

        if (iTunesFile != null && (new File(iTunesFile)).exists()) {
          iTunesLib = Plist.load(URLDecoder.decode(iTunesFile, System.getProperty("file.encoding"))); // loads the (nested) properties.
          Tracks = (Map<?, ?>) iTunesLib.get("Tracks"); // the list of tracks
          Playlists = (List<?>) iTunesLib.get("Playlists"); // the list of Playlists
          res = new VirtualFolder("iTunes Library", null);

          VirtualFolder playlistsFolder = null;

          for (Object item : Playlists) {
            Playlist = (Map<?, ?>) item;

            if (Playlist.containsKey("Visible") && Playlist.get("Visible").equals(Boolean.FALSE)) {
              continue;
            }

            if (Playlist.containsKey("Music") && Playlist.get("Music").equals(Boolean.TRUE)) {
              // Create virtual folders for artists, albums and genres

              VirtualFolder musicFolder = new VirtualFolder(Playlist.get("Name").toString(), null);
              res.addChild(musicFolder);

              VirtualFolder virtualFolderArtists = new VirtualFolder(Messages.getString("FoldTab.50"), null);
              VirtualFolder virtualFolderAlbums = new VirtualFolder(Messages.getString("FoldTab.51"), null);
              VirtualFolder virtualFolderGenres = new VirtualFolder(Messages.getString("FoldTab.52"), null);
              VirtualFolder virtualFolderAllTracks = new VirtualFolder(Messages.getString("PMS.11"), null);
              PlaylistTracks = (List<?>) Playlist.get("Playlist Items"); // list of tracks in a playlist

              String artistName;
              String albumName;
              String genreName;

              if (PlaylistTracks != null) {
                for (Object t : PlaylistTracks) {
                  Map<?, ?> td = (Map<?, ?>) t;
                  track = (Map<?, ?>) Tracks.get(td.get("Track ID").toString());

                  if (
                    track != null &&
                    track.get("Location") != null &&
                    track.get("Location").toString().startsWith("file://")
                  ) {
                    String name = Normalizer.normalize((String) track.get("Name"), Normalizer.Form.NFC);
                    // remove dots from name to prevent media renderer from trimming
                    name = name.replace('.', '-');

                    if (track.containsKey("Protected") && track.get("Protected").equals(Boolean.TRUE)) {
                      name = String.format(Messages.getString("RootFolder.1"), name);
                    }

                    boolean isCompilation = (track.containsKey("Compilation") && track.get("Compilation").equals(Boolean.TRUE));

                    artistName = (String) track.get("Artist");
                    if (isCompilation) {
                      artistName = "Compilation";
                    } else if (track.containsKey("Album Artist")) {
                      artistName = (String) track.get("Album Artist");
                    }
                    albumName = (String) track.get("Album");
                    genreName = (String) track.get("Genre");

                    if (artistName == null) {
                      artistName = "Unknown Artist";
                    } else {
                      artistName = Normalizer.normalize(artistName, Normalizer.Form.NFC);
                    }

                    if (albumName == null) {
                      albumName = "Unknown Album";
                    } else {
                      albumName = Normalizer.normalize(albumName, Normalizer.Form.NFC);
                    }

                    if (genreName == null || "".equals(genreName.replaceAll("[^a-zA-Z]", ""))) {
                      // This prevents us from adding blank or numerical genres
                      genreName = "Unknown Genre";
                    } else {
                      genreName = Normalizer.normalize(genreName, Normalizer.Form.NFC);
                    }

                    // Replace &nbsp with space and then trim
                    artistName = artistName.replace('\u0160', ' ').trim();
                    albumName  = albumName.replace('\u0160', ' ').trim();
                    genreName  = genreName.replace('\u0160', ' ').trim();

                    URI tURI2 = new URI(track.get("Location").toString());
                    File refFile = new File(URLDecoder.decode(tURI2.toURL().getFile(), "UTF-8"));
                    RealFile file = new RealFile(refFile, name);

                    // Put the track into the artist's album folder and the artist's "All tracks" folder
                    {
                      VirtualFolder individualArtistFolder = null;
                      VirtualFolder individualArtistAllTracksFolder;
                      VirtualFolder individualArtistAlbumFolder = null;

                      for (DLNAResource artist : virtualFolderArtists.getChildren()) {
                        if (areNamesEqual(artist.getName(), artistName)) {
                          individualArtistFolder = (VirtualFolder) artist;
                          for (DLNAResource album : individualArtistFolder.getChildren()) {
                            if (areNamesEqual(album.getName(), albumName)) {
                              individualArtistAlbumFolder = (VirtualFolder) album;
                            }
                          }
                          break;
                        }
                      }

                      if (individualArtistFolder == null) {
                        individualArtistFolder = new VirtualFolder(artistName, null);
                        virtualFolderArtists.addChild(individualArtistFolder);
                        individualArtistAllTracksFolder = new VirtualFolder(Messages.getString("PMS.11"), null);
                        individualArtistFolder.addChild(individualArtistAllTracksFolder);
                      } else {
                        individualArtistAllTracksFolder = (VirtualFolder) individualArtistFolder.getChildren().get(0);
                      }

                      if (individualArtistAlbumFolder == null) {
                        individualArtistAlbumFolder = new VirtualFolder(albumName, null);
                        individualArtistFolder.addChild(individualArtistAlbumFolder);
                      }

                      individualArtistAlbumFolder.addChild(file.clone());
                      individualArtistAllTracksFolder.addChild(file);
                    }

                    // Put the track into its album folder
                    {
                      if (!isCompilation) {
                        albumName += " - " + artistName;
                      }

                      VirtualFolder individualAlbumFolder = null;
                      for (DLNAResource album : virtualFolderAlbums.getChildren()) {
                        if (areNamesEqual(album.getName(), albumName)) {
                          individualAlbumFolder = (VirtualFolder) album;
                          break;
                        }
                      }
                      if (individualAlbumFolder == null) {
                        individualAlbumFolder = new VirtualFolder(albumName, null);
                        virtualFolderAlbums.addChild(individualAlbumFolder);
                      }
                      individualAlbumFolder.addChild(file.clone());
                    }

                    // Put the track into its genre folder
                    {
                      VirtualFolder individualGenreFolder = null;
                      for (DLNAResource genre : virtualFolderGenres.getChildren()) {
                        if (areNamesEqual(genre.getName(), genreName)) {
                          individualGenreFolder = (VirtualFolder) genre;
                          break;
                        }
                      }
                      if (individualGenreFolder == null) {
                        individualGenreFolder = new VirtualFolder(genreName, null);
                        virtualFolderGenres.addChild(individualGenreFolder);
                      }
                      individualGenreFolder.addChild(file.clone());
                    }

                    // Put the track into the global "All tracks" folder
                    virtualFolderAllTracks.addChild(file.clone());
                  }
                }
              }

              musicFolder.addChild(virtualFolderArtists);
              musicFolder.addChild(virtualFolderAlbums);
              musicFolder.addChild(virtualFolderGenres);
              musicFolder.addChild(virtualFolderAllTracks);

              // Sort the virtual folders alphabetically
              Collections.sort(virtualFolderArtists.getChildren(), new Comparator<DLNAResource>() {
                @Override
                public int compare(DLNAResource o1, DLNAResource o2) {
                  VirtualFolder a = (VirtualFolder) o1;
                  VirtualFolder b = (VirtualFolder) o2;
                  return a.getName().compareToIgnoreCase(b.getName());
                }
              });

              Collections.sort(virtualFolderAlbums.getChildren(), new Comparator<DLNAResource>() {
                @Override
                public int compare(DLNAResource o1, DLNAResource o2) {
                  VirtualFolder a = (VirtualFolder) o1;
                  VirtualFolder b = (VirtualFolder) o2;
                  return a.getName().compareToIgnoreCase(b.getName());
                }
              });

              Collections.sort(virtualFolderGenres.getChildren(), new Comparator<DLNAResource>() {
                @Override
                public int compare(DLNAResource o1, DLNAResource o2) {
                  VirtualFolder a = (VirtualFolder) o1;
                  VirtualFolder b = (VirtualFolder) o2;
                  return a.getName().compareToIgnoreCase(b.getName());
                }
              });
            } else {
              // Add all playlists
              VirtualFolder pf = new VirtualFolder(Playlist.get("Name").toString(), null);
              PlaylistTracks = (List<?>) Playlist.get("Playlist Items"); // list of tracks in a playlist

              if (PlaylistTracks != null) {
                for (Object t : PlaylistTracks) {
                  Map<?, ?> td = (Map<?, ?>) t;
                  track = (Map<?, ?>) Tracks.get(td.get("Track ID").toString());

                  if (
                    track != null &&
                    track.get("Location") != null &&
                    track.get("Location").toString().startsWith("file://")
                  ) {
                    String name = Normalizer.normalize(track.get("Name").toString(), Normalizer.Form.NFC);
                    // remove dots from name to prevent media renderer from trimming
                    name = name.replace('.', '-');

                    if (track.containsKey("Protected") && track.get("Protected").equals(Boolean.TRUE)) {
                      name = String.format(Messages.getString("RootFolder.1"), name);
                    }

                    URI tURI2 = new URI(track.get("Location").toString());
                    RealFile file = new RealFile(new File(URLDecoder.decode(tURI2.toURL().getFile(), "UTF-8")), name);
                    pf.addChild(file);
                  }
                }
              }

              int kind = Playlist.containsKey("Distinguished Kind") ? ((Number) Playlist.get("Distinguished Kind")).intValue() : -1;
              if (kind >= 0 && kind != 17 && kind != 19 && kind != 20) {
                // System folder, but not voice memos (17) and purchased items (19 & 20)
                res.addChild(pf);
              } else {
                // User playlist or playlist folder
                if (playlistsFolder == null) {
                  playlistsFolder = new VirtualFolder("Playlists", null);
                  res.addChild(playlistsFolder);
                }
                playlistsFolder.addChild(pf);
              }
            }
View Full Code Here

    return res;
  }

  private void addAdminFolder() {
    DLNAResource res = new VirtualFolder(Messages.getString("PMS.131"), null);
    DLNAResource vsf = getVideoSettingsFolder();

    if (vsf != null) {
      res.addChild(vsf);
    }

    res.addChild(new VirtualFolder(Messages.getString("NetworkTab.39"), null) {
      @Override
      public void discoverChildren() {
        final ArrayList<DownloadPlugins> plugins = DownloadPlugins.downloadList();
        for (final DownloadPlugins plugin : plugins) {
          addChild(new VirtualVideoAction(plugin.getName(), true) {
            @Override
            public boolean enable() {
              try {
                plugin.install(null);
              } catch (Exception e) {
              }

              return true;
            }
          });
        }
      }
    });

    if (configuration.getScriptDir() != null) {
      final File scriptDir = new File(configuration.getScriptDir());

      if (scriptDir.exists()) {
        res.addChild(new VirtualFolder(Messages.getString("PMS.132"), null) {
          @Override
          public void discoverChildren() {
            File[] files = scriptDir.listFiles();
            for (File file : files) {
              String name = file.getName().replaceAll("_", " ");
              int pos = name.lastIndexOf('.');

              if (pos != -1) {
                name = name.substring(0, pos);
              }

              final File f = file;

              addChild(new VirtualVideoAction(name, true) {
                @Override
                public boolean enable() {
                  try {
                    ProcessBuilder pb = new ProcessBuilder(f.getAbsolutePath());
                    Process pid = pb.start();
                    InputStream is = pid.getInputStream();
                    BufferedReader br;
                    try (InputStreamReader isr = new InputStreamReader(is)) {
                      br = new BufferedReader(isr);
                      while (br.readLine() != null) {
                      }
                    }
                    br.close();
                    pid.waitFor();
                  } catch (IOException | InterruptedException e) {
                  }

                  return true;
                }
              });
            }
          }
        });
      }
    }

    // Resume file management
    if (configuration.isResumeEnabled()) {
      res.addChild(new VirtualFolder(Messages.getString("PMS.135"), null) {
        @Override
        public void discoverChildren() {
          final File[] files = ResumeObj.resumeFiles();
          addChild(new VirtualVideoAction(Messages.getString("PMS.136"), true) {
            @Override
            public boolean enable() {
              for (File f : files) {
                f.delete();
              }
              getParent().getChildren().remove(this);
              return false;
            }
          });
          for (final File f : files) {
            String name = FileUtil.getFileNameWithoutExtension(f.getName());
            name = name.replaceAll(ResumeObj.CLEAN_REG, "");
            addChild(new VirtualVideoAction(name, false) {
              @Override
              public boolean enable() {
                f.delete();
                getParent().getChildren().remove(this);
                return false;
              }
            });
          }
        }
      });
    }

    // recently played mgmt
    if (last != null) {
      final List<DLNAResource> l = last.getList();
      res.addChild(new VirtualFolder(Messages.getString("PMS.137"), null) {
        @Override
        public void discoverChildren() {
          addChild(new VirtualVideoAction(Messages.getString("PMS.136"), true) {
            @Override
            public boolean enable() {
View Full Code Here

   */
  private DLNAResource getVideoSettingsFolder() {
    DLNAResource res = null;

    if (!configuration.getHideVideoSettings()) {
      res = new VirtualFolder(Messages.getString("PMS.37"), null);
      VirtualFolder vfSub = new VirtualFolder(Messages.getString("PMS.8"), null);
      res.addChild(vfSub);

      res.addChild(new VirtualVideoAction(Messages.getString("PMS.3"), configuration.isMencoderNoOutOfSync()) {
        @Override
        public boolean enable() {
          configuration.setMencoderNoOutOfSync(!configuration.isMencoderNoOutOfSync());
          return configuration.isMencoderNoOutOfSync();
        }
      });

      res.addChild(new VirtualVideoAction(Messages.getString("PMS.14"), configuration.isMencoderMuxWhenCompatible()) {
        @Override
        public boolean enable() {
          configuration.setMencoderMuxWhenCompatible(!configuration.isMencoderMuxWhenCompatible());

          return configuration.isMencoderMuxWhenCompatible();
        }
      });

      res.addChild(new VirtualVideoAction("  !!-- Fix 23.976/25fps A/V Mismatch --!!", configuration.isFix25FPSAvMismatch()) {
        @Override
        public boolean enable() {
          configuration.setMencoderForceFps(!configuration.isFix25FPSAvMismatch());
          configuration.setFix25FPSAvMismatch(!configuration.isFix25FPSAvMismatch());
          return configuration.isFix25FPSAvMismatch();
        }
      });

      res.addChild(new VirtualVideoAction(Messages.getString("PMS.4"), configuration.isMencoderYadif()) {
        @Override
        public boolean enable() {
          configuration.setMencoderYadif(!configuration.isMencoderYadif());

          return configuration.isMencoderYadif();
        }
      });

      vfSub.addChild(new VirtualVideoAction(Messages.getString("TrTab2.51"), configuration.isDisableSubtitles()) {
        @Override
        public boolean enable() {
          boolean oldValue = configuration.isDisableSubtitles();
          boolean newValue = !oldValue;
          configuration.setDisableSubtitles(newValue);
          return newValue;
        }
      });

      vfSub.addChild(new VirtualVideoAction(Messages.getString("MEncoderVideo.22"), configuration.isAutoloadExternalSubtitles()) {
        @Override
        public boolean enable() {
          boolean oldValue = configuration.isAutoloadExternalSubtitles();
          boolean newValue = !oldValue;
          configuration.setAutoloadExternalSubtitles(newValue);
          return newValue;
        }
      });

      vfSub.addChild(new VirtualVideoAction(Messages.getString("MEncoderVideo.36"), configuration.isUseEmbeddedSubtitlesStyle()) {
        @Override
        public boolean enable() {
          boolean oldValue = configuration.isUseEmbeddedSubtitlesStyle();
          boolean newValue = !oldValue;
          configuration.setUseEmbeddedSubtitlesStyle(newValue);
View Full Code Here

TOP

Related Classes of net.pms.dlna.virtual.VirtualFolder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.