Using the Converters and the Prefix Transformations you are able to transform the video/music path depending on the playing location.

The following Example shows a configuration to swoosh between two different computers, WorkPC and MediaPC. On the WorkPC, VLC and Winamp are installed; on the MediaPC there is XBMC running.
We mapped the local path C:\Movies on the WorkPC to the appropriate path \\WORKPC\Share\Movies on the MediaPC and vice versa. As only the first part of the filepath is transformed, MediaPC can now easily access the Files over the network share, without streaming or duplicating the files. Of course it would be also possible to have an independet Storage Device, which both Computers are accessing. Another possibility would be, to store the files on both Computers at exactly the same path - then you could omit the Prefix Transformations.
This XML configuration is flexible and can be used for many situations.

<?xml version="1.0" encoding="utf-8"?>
<SwooshConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <StorageList>
    <Storage>
      <Name>WorkPCStorage</Name>
      <Converters>
        <ConverterItem>
          <!-- Defines, how the destination can access the mediafiles of the source -->
          <DestinationStorage>MediaPCStorage</DestinationStorage>
          <PrefixTransformation>
            <PrefixTransformationItem>
              <!--the "From"-part of the filepath will be replaced with the "To"-path -->
              <From>C:\Movies</From>
              <To>\\WORKPC\Share\Movies</To>
            </PrefixTransformationItem>
            <PrefixTransformationItem>
              <From>C:\Music</From>
              <To>\\WORKPC\Share\Music</To>
            </PrefixTransformationItem>
          </PrefixTransformation>
        </ConverterItem>
        <ConverterItem>
          <DestinationStorage>WorkPCStorage</DestinationStorage>
          <PrefixTransformation />
        </ConverterItem>
      </Converters>
    </Storage>
    <Storage>
      <Name>MediaPCStorage</Name>
      <Converters>
        <ConverterItem>
          <DestinationStorage>WorkPCStorage</DestinationStorage>
          <PrefixTransformation>
            <PrefixTransformationItem>
              <From>D:\Movies</From>
              <To>\\MEDIAPC\Share\Movies</To>
            </PrefixTransformationItem>
            <PrefixTransformationItem>
              <From>D:\Music</From>
              <To>\\MEDIAPC\Share\Music</To>
            </PrefixTransformationItem>
          </PrefixTransformation>
        </ConverterItem>
        <ConverterItem>
          <DestinationStorage>MediaPCStorage</DestinationStorage>
          <PrefixTransformation />
        </ConverterItem>
      </Converters>
    </Storage>
  </StorageList>
  <PlaybackDevices>
    <!--In this section, the available VLCPlayers are listed. 
    In this example, there is just one, running on WorkPC-->
    <PlaybackDevice>
      <Name>VLCWorkPC</Name>
      <StorageName>WorkPCStorage</StorageName>
      <PlayerClass>Swoosh.MediaPlayers.VlcOldHttp.Player</PlayerClass>
      <Configuration>
        <PlayerConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <ServerName>NAME_OR_IP</ServerName>
          <ServerPort>51000</ServerPort>
        </PlayerConfig>
      </Configuration>
    </PlaybackDevice>
    <PlaybackDevice>
      <Name>XBMCMediaPC</Name>
      <StorageName>MediaPCStorage</StorageName>
      <PlayerClass>Swoosh.MediaPlayers.XbmcDharma.Player</PlayerClass>
      <Configuration>
        <PlayerConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <ServerName>NAME_OR_IP</ServerName>
          <ServerPort>51001</ServerPort>
        </PlayerConfig>
      </Configuration>
    </PlaybackDevice>
    <PlaybackDevice>
      <Name>WinampWorkPC</Name>
      <StorageName>MediaPCStorage</StorageName>
      <PlayerClass>Swoosh.MediaPlayers.WinampAjaxAmpV3.Player</PlayerClass>
      <Configuration>
        <PlayerConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <ServerName>NAME_OR_IP</ServerName>
          <ServerPort>5151</ServerPort>
        </PlayerConfig>
      </Configuration>
    </PlaybackDevice>
  </PlaybackDevices>
  <SwooshActionList>
    <SwooshAction>
      <!-- The key "CTRL+ALT+NumPad6" would cause a swoosh from VLC, 
      running on WorkPC - to XBMC, running on MediaPC-->
      <Trigger>
        <Keys>LControlKey</Keys>
        <Keys>LMenu</Keys>
        <Keys>NumPad6</Keys>
      </Trigger>
      <SourcePlayerName>VLCWorkPC</SourcePlayerName>
      <DestinationPlayerName>XBMCMediaPC</DestinationPlayerName>
    </SwooshAction>
    <SwooshAction>
      <!-- The key "CTRL+ALT+NumPad4" would cause a swoosh from XBMC, 
      running on MediaPC - to VLC, running on WorkPC-->
      <Trigger>
        <Keys>LControlKey</Keys>
        <Keys>LMenu</Keys>
        <Keys>NumPad4</Keys>
      </Trigger>
      <SourcePlayerName>XBMCMediaPC</SourcePlayerName>
      <DestinationPlayerName>VLCWorkPC</DestinationPlayerName>
    </SwooshAction>
    <SwooshAction>
      <!-- The key "CTRL+ALT+NumPad1" would cause a swoosh from Winamp, 
      running on WorkPC - to XBMC, running on MediaPC-->
      <Trigger>
        <Keys>LControlKey</Keys>
        <Keys>LMenu</Keys>
        <Keys>NumPad1</Keys>
      </Trigger>
      <SourcePlayerName>WinampWorkPC</SourcePlayerName>
      <DestinationPlayerName>XBMCMediaPC</DestinationPlayerName>
    </SwooshAction>
  </SwooshActionList>
</SwooshConfig>

Last edited Jan 18, 2012 at 10:07 AM by DonGeatschos, version 6

Comments

No comments yet.