Examples of DeviceIf


Examples of captureplugin.drivers.DeviceIf

     * @return DeviceIf
     * @throws java.io.IOException  Problems while reading the device
     * @throws ClassNotFoundException Class creation problems
     */
    public DeviceIf readDevice(String classname, String filename, String devname) throws IOException, ClassNotFoundException {
        final DeviceIf dev = DriverFactory.getInstance().createDevice(classname, devname);
       
        if (dev == null) {
            return null;
        }
       
        File data = new File(Plugin.getPluginManager().getTvBrowserSettings().getTvBrowserUserHome()  + File.separator +
                "CaptureDevices" + File.separator + filename);
        StreamUtilities.objectInputStreamIgnoringExceptions(data, 0x2000,
        new ObjectInputStreamProcessor() {

          @Override
          public void process(final ObjectInputStream inputStream) throws IOException {
            try {
              dev.readData(inputStream, false);
            } catch (ClassNotFoundException e) {
              e.printStackTrace();
            }
          }});
       
View Full Code Here

Examples of captureplugin.drivers.DeviceIf

        for (int i = 0; i < num; i++) {
            String classname = (String) in.readObject();
            String devname = (String)in.readObject();
            String filename = (String)in.readObject();
            try {
                DeviceIf dev = reader.readDevice(classname, filename, devname);
               
                if (dev != null) {
                    mDevices.add(dev);
                }
            } catch (Throwable e) {
View Full Code Here

Examples of captureplugin.drivers.DeviceIf

    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {

        JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
       
        if (value instanceof DeviceIf) {
            DeviceIf device = (DeviceIf)value;
            String str = device.getName() + " (" + device.getDriver().getDriverName()
          + ")";
            label.setText(str);
        }
       
        return label;
View Full Code Here

Examples of captureplugin.drivers.DeviceIf

       if ((row > mProgramTableModel.getRowCount()) || (row < 0)) {
           return;
       }

       DeviceIf dev = (DeviceIf) mProgramTableModel.getValueAt(row, 0);
       Program prg = (Program) mProgramTableModel.getValueAt(row, 1);

       int ret = JOptionPane.showConfirmDialog(UiUtilities.getLastModalChildOf(mParent),
               mLocalizer.msg("ReallyDelete","Really delete recording?"),
               Localizer.getLocalization(Localizer.I18N_DELETE)+"?",
               JOptionPane.YES_NO_OPTION);

       if (ret == JOptionPane.YES_OPTION) {
           dev.remove(UiUtilities.getLastModalChildOf(mParent), prg);

           mProgramTableModel.removeColumn(row);

           createListData();
       }
View Full Code Here

Examples of captureplugin.drivers.DeviceIf

    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
       
        if (value instanceof DeviceIf) {
            DeviceIf device = (DeviceIf)value;
            String str = device.getName() + " (" + device.getDriver().getDriverName()
          + ")";
            label.setText(str);
        }
       
        return label;
View Full Code Here

Examples of captureplugin.drivers.DeviceIf

      in.readObject(); // Warning in File
     
      String classname = (String) in.readObject();
      String devname = (String)in.readObject();
     
      DeviceIf dev = DriverFactory.getInstance().createDevice(classname, devname);
     
      if (dev == null) {
          mError = mLocalizer.msg("ProblemsCreating","Problems while creating the Device");
          return null;
      }

      dev.readData(in,true);
     
      return dev;
    } catch (Exception e) {
      mError = mLocalizer.msg("ProblemsReading","Problems while reading the File");
      mException = e;
View Full Code Here

Examples of captureplugin.drivers.DeviceIf

     */
    private Vector<Program> getMarkedByDevices() {
        Vector<Program> v = new Vector<Program>();

        for (Object o : mConfig.getDevices()) {
            DeviceIf device = (DeviceIf) o;

            Program[] programs = device.getProgramList();

            if (programs != null) {
                for (Program program : programs) {
                    if (!v.contains(program)) {
                        v.add(program);
View Full Code Here

Examples of captureplugin.drivers.DeviceIf

    private void updateTreeNode() {
        mRootNode.removeAllChildren();
        mRootNode.removeAllActions();

        for (Object o : mConfig.getDevices()) {
            final DeviceIf device = (DeviceIf) o;

            PluginTreeNode node;
            if (mConfig.getDevices().size() > 1) {
              node = new PluginTreeNode(device.getName());
              mRootNode.add(node);
            }
            else {
              node = mRootNode;
            }

            if(device.isAbleToAddAndRemovePrograms()) {
              node.getMutableTreeNode().setProgramReceiveTarget(new ProgramReceiveTarget(this, device.getName() + " - " + mLocalizer.msg("record", "record"), device.getId() + RECORD));
            }

            Program[] programs = device.getProgramList();

            if (programs != null) {
              for (Program program : programs) {
                  node.addProgram(program);
              }
            }

            node.addAction(new AbstractAction(mLocalizer.msg("configure", "Configure '{0}'", device.getName())) {
              @Override
              public void actionPerformed(ActionEvent e) {
                device.configDevice(UiUtilities.getBestDialogParent(getParentFrame()));
                updateTreeNode();
              }
            });
        }
View Full Code Here

Examples of captureplugin.drivers.DeviceIf

    private void addDevice() {
        Window parent = UiUtilities.getLastModalChildOf(mOwner);
        DeviceCreatorDialog dialog = new DeviceCreatorDialog(parent);
        UiUtilities.centerAndShow(dialog);
       
        DeviceIf device = dialog.createDevice();
       
        if (device != null) {
            mData.getDevices().add(device);
            device.configDevice(UiUtilities.getLastModalChildOf(mOwner));
            mDeviceList.setListData(new Vector<DeviceIf>(mData.getDevices()));
        }
    }
View Full Code Here

Examples of captureplugin.drivers.DeviceIf

    /**
     * Configure a selected Device
     */
    private void configDevice() {
        DeviceIf device = (DeviceIf) mDeviceList.getSelectedValue();
       
        if (device != null) {
            device.configDevice(UiUtilities.getLastModalChildOf(mOwner));
            mDeviceList.repaint();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.